ZX BASIC:BitWiseLogic

From BorielWiki
Jump to: navigation, search

ZX Basic allows Bit Manipulation (bitwise), on every integer type (from 8 to 32 bits).

Table of BITWISE OPERATORS
bAND bOR bNOT bXOR
Performs the Bitwise Conjunction and returns 1 for every bit if and only if both bits are 1.


a AND b
a b Result
0 0 0
0 1 0
1 0 0
1 1 1


Performs the Bitwise Disjunction and returns 1 if any of the arguments is 1.


a OR b
a b Result
0 0 0
0 1 1
1 0 1
1 1 1


Performs the Logical Negation and returns TRUE if the arguments is False and vice versa.


NOT a
a Result
False True
True False


Performs a logical XOR and returns TRUE if one of the arguments is true and one of the arguments is false. In essense, returns true if ONLY one of the arguments is true.


a XOR b
a
b
Result
False
False
False
False
True
True
True
False
True
True
True
False
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Translate
Google AdSense