GJ>What is the best way to deal with bits? This is the way I have delt with
them
GJ>so far (just started learning asm 3 days ago):
GJ>and al,00100000b
GJ>cmp al,00100000b
GJ>Is that the best way to test bits?
No. A better way is to use the operand TEST, which ANDs the bits, but stores
only the flags from doing so, and not the results. Anyway, after an AND or a
TEST, the CMP is unnecessary. The Zero flag will be the opposite of the bit
being tested, and if you used TEST, you don't lose the original value of the
register.
((Cloud))
MauveCloud@juno.com
* OLX 2.2 * Detour: The roughest distance between two points.
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|