KW> NC> Maybe I can use a BASIC statement to illustrate logical:
KW> NC> IF a% AND b% THEN ....
KW> NC> BASIC determines a value to be TRUE if it is nonzero. If a% is
KW> NC> TRUE, and b% is TRUE, then do the stuff after THEN.
KW>correct me if i'm wrong, but if you look at the actual contents of a
KW>boolean value, don't you find 1 or 0? true and false are just
In the case of the BASIC example being referred to a TRUE value can be a
positive OR negative number! :)
Thus:
IF 1 AND 1 THEN ...
IF -1 AND -1 THEN ...
In both cases they evaluate as TRUE and the THEN part executes. Using -1 as
TRUE has the advantage of using NOT to toggle the state.
ie:
TRUE = -1
FALSE = NOT TRUE (0)
mov AX,-1 (AX = 0FFFFh)
not AX (AX = 0
not AX (AX - 0FFFFh -1)
Cheers,
Denis Boyles
* OLX 2.1 TD * If this were an actual tagline, it would be funny.
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)
|