intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF

int e l 5.1 DUAL OPERAND OPERATIONS .AND. LOGICAL AND OPERATOR EXAMPLE: PRINT 3.AND.2 2 .OR. LOGICAL OR OPERATOR EXAMPLE: PRINT 1.OR.4 5 .XOR. LOGICAL EXCLUSIVE OR OPERATOR EXAMPLE: PRINT 7.XOR.6 1 COMMENTS ON LOGICAL OPERATORS .AND., .OR., and .XOR. These operators perform a BIT-WISE logical function on valid INTEGERS. That means both arguments for these operators must be between 0 and 65535 (0FFFFH) inclusive. If they are not, MCS BASIC-52 will generate a BAD ARGUMENT ERROR. All non-integer values are truncated, NOT rounded. You may wonder why the notation .OP. was chosen for the logical functions.

The only reason for this is that MCS BASIC-52 eliminates ALL spaces when it processes a user line and inserts spaces before and after STATEMENTS when it LISTS a user program. MCS BASIC-52 does not insert spaces before and after operators. So, if the user types in a line such as 10 A = 10 * 10, this line will be listed as 10 A= 10*10. All spaces entered by the user before and after the operator will be eliminated. The .OP. notation was chosen for the logical operators because a line entered as 10 B = A AND B would be listed as 10 B = AANDB.

This just looked confusing, so the dots were added to the logical instructions and the previous example would be listed as 10 B=A.AND.B, which is easier to read. - 75 -