Post Reply 
(16C) show which bits are set in a number
03-06-2019, 06:57 PM
Post: #9
RE: (16C) show which bits are set in a number
(03-06-2019 09:41 AM)wynen Wrote:  
Code:
008-43, 6, 4 :   F? 4      // carry set?
009-   43  2 :   x<0       // yes, but x<0 is always false (because of shift right)
010-   22  1 :   GTO 1     // carry not set

Ah, great – one of the good old tricks from the golden days of RPN programming: have a test followed by another one that always tests false, and you get an inverse test. So the combination of F? 4 and x<0? tests if flag 4 is clear.

I wouldn't have expected that anyone may still remember these things. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (16C) show which bits are set in a number - Dieter - 03-06-2019 06:57 PM



User(s) browsing this thread: 2 Guest(s)