' Logical & Bitwise — AND OR XOR NOT EQV IMP
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL a AS LONG
    LOCAL b AS LONG

    a = 12       ' 1100 binary
    b = 10       ' 1010 binary

    PRINT "a = " + STR$(a) + " (binary 1100)"
    PRINT "b = " + STR$(b) + " (binary 1010)"
    PRINT STRING$(40, 45)
    PRINT
    PRINT "a AND b  = " + STR$(a AND b)
    PRINT "a OR  b  = " + STR$(a OR b)
    PRINT "a XOR b  = " + STR$(a XOR b)
    PRINT "NOT a    = " + STR$(NOT a)
    PRINT "a EQV b  = " + STR$(a EQV b)
    PRINT "a IMP b  = " + STR$(a IMP b)

    PRINT
    PRINT "Logical (boolean) usage:"
    PRINT "(1 AND 1)  = " + STR$(1 AND 1)
    PRINT "(1 AND 0)  = " + STR$(1 AND 0)
    PRINT "(1 OR 0)   = " + STR$(1 OR 0)
    PRINT "(0 OR 0)   = " + STR$(0 OR 0)

    FUNCTION = 0
END FUNCTION
