TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: GILES JACOBSEN
from: BRIAN MCCLOUD
date: 1997-07-25 07:44:00
subject: bits

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.