Re: Programming "AND" of two flags in the non RPL machines Message #8 Posted by Stefan Vorkoetter on 23 Aug 2007, 9:56 a.m., in response to message #3 by Valentin Albillo
Another solution that preserves the stack and LASTx uses a third flag. So if you're testing flags 0 and 1, the following will set flag 2 to the AND of flags 0 and 1, and then test the result:
SF 2
FC? 0
CF 2
FC? 1
CF 2
FS? 2
Likewise, the following does OR:
CF 2
FS? 0
SF 2
FS? 1
SF 2
FS? 2
Alternatively, if all you're interested in is branching somewhere if the AND is true, you could write:
FC? 0
GTO N
FC? 1
GTO N
LBL A
...stuff to do if flags 0 and 1 are set
LBL N
...stuff to do if one or both of flags 0 and 1 are not set
Stefan
|