From: Nick.Coons@f404.n114.z1.gryn.org (Nick Coons)
Newsgroups: trends.fido.80xxx
Subject: 486 MOV.
Organization: Dynamic Computer Systems
Hi Kurt!
> NC> The difference being that bitwise functions simply look at the
> NC> bits of a number (or two numbers) and act accordingly. Logical
> NC> functions check to see if a value is TRUE or FALSE. Since OR, AND,
> but true and false are expressable as 1 and 0... and on a pc they're
> the same thing...
Usually you use 0 as FALSE and -1 as TRUE. Since 0 = NOT -1 and
-1 = NOT 0.
> NC> The best way to demonstrate logical operators is to use
> NC> real-life situations. Let's say your father asked you, "Did you take
> NC> out the trash AND do the dishes?"
> is bit 7 set in both ax AND dx?
Yeah, that would be a similar situation.
> NC> Maybe I can use a BASIC statement to illustrate logical:
> NC> IF a% AND b% THEN ....
> NC> BASIC determines a value to be TRUE if it is nonzero. If a% is
> NC> TRUE, and b% is TRUE, then do the stuff after THEN.
> correct me if i'm wrong, but if you look at the actual contents of a
> boolean value, don't you find 1 or 0?
That would depend on the language you're using. In BASIC, you use 0
for FALSE and -1 for TRUE since the smallest piece of data you can manipulate
is 1 byte. And I think with C you can manipulate individual bits, so TRUE
would be if the bit was set, and FALSE would be if it was not set. With
VisualBASIC, the values for TRUE and FALSE are predetermined, so I don't know
what they are (I never bothered to check).
Nick Coons
nick.coons@juno.com
Dynamic Computer Systems
---
---------------
* Origin: Dynamic Computer Systems (1:12/98.1)
|