HTBasic Help
×
Menu
Index

BINIOR

Performs a bit by bit inclusive OR.
 
 BINIOR( arg, arg )
 
Where:
arg = numeric-expression rounded to an INTEGER
 
Usage:
Set=BINIOR(Byte,Bit)
Msb=BINIOR(-1,2^14)
 
Example:      BINIOR.BAS
 
Description:
BINIOR can be used to set specific bits. BINIOR(A,B) converts the values of A and B to integers. The integer values of A and B are then treated as unsigned binary numbers. Each bit of the result is set to 1 if the corresponding bit of either or both A or B is 1, and 0 if the corresponding bits of both A and B are 0. An example of BINIOR is:
 
BINIOR(12,6)
 
The numbers 12 and 6 are considered binary numbers, then the bitwise OR is performed.
 
12           = 0000000000001100
6            = 0000000000000110
BINIOR(12,6) = 0000000000001110
 
The resulting binary number represents 14.
See Also: