Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileAND(x,y) OR(x,y) XOR(x,y) IMP(x,y) EQV(x,y) x, y: iexp These functions operate logically on two numerical expressions. The function AND() returns a result in which only those bits are set which are set in both x and y. The result of OR() contains bits set in the places in which bits are set in either x or y or both. XOR() sets only those bits which are set in x or y but not both (or, to put it another way: XOR() sets those bits which are different in x and y). IMP() resets a bit to zero if the appropriate bit in x is set and in y is reset, otherwise the bit is set. EQV() sets a bit of the result if the appropriate bits in x and y are both set, or both reset. See the section on Logical Operators for the truth table for this function. Examples: x=3 y=2 z=AND(x,y) PRINT z,OR(2,7),XOR(x,1+4+8) --> On the screen, the numbers 2, 7, and 14 appear. PRINT BIN$(15,4),15 PRINT BIN$(6,4),6 PRINT BIN$(IMP(15,6),4),"IMP(15,6)" PRINT BIN$(EQV(15,6),4),"EQV(15,6)" --> Displays: 1111 15 0110 6 0110 IMP(15,6) 0110 EQV(15,6)