' *** EQV.GFA *** ' ' *** EQV compares bit 0-15 only (no integers), fills bit 16-31 with 1 ' *** GFA 3.07; compiled program: OK; GFA 3.5E: OK ' CLS ' PRINT PRINT " The operator EQV sets a bit if the two corresponding bits in two variables" PRINT " are either both 0 or both 1 (equivalent). If all bits are equal, EQV returns" PRINT " -1. If all bits are different, 0 should be returned." PRINT PRINT " Unfortunately EQV compares bit 0-15 only, so you can't use integers. EQV" PRINT " always fills bit 16-31 with 1, so 0 will not be returned if all bits are" PRINT " different. If you clear bit 16-31, you can use EQV to check if all bits are" PRINT " different in two byte- or word-variables. And of course you can use EQV to" PRINT " check if all bits of two byte- or word-variables are equal, but that can also" PRINT " be done with '='." PRINT PRINT " To make things more interesting, in a compiled program EQV seems to work" PRINT " all right: all 32 bits are checked properly. In GFA 3.5E also OK." PRINT PRINT PRINT " EQV(0,0) = ";EQV(0,0); PRINT TAB(30);" correct, all bits are equal (all 0)" PRINT " EQV(-1,-1) = ";EQV(-1,-1); PRINT TAB(30);" wrong (interpreter), all bits are equal (all 1)" PRINT " EQV(&HFFFF,&HFFFF) = ";EQV(&HFFFF,&HFFFF); PRINT TAB(30);" correct, bits 0-15 all equal (all 1)" PRINT " EQV(&H1FFFF,&H1FFFF) = ";EQV(&H1FFFF,&H1FFFF); PRINT TAB(30);" bug from bit 16 (interpreter)" ' ~INP(2) CLS