[Coco] replicating bitwise operators in BASIC

Melanie and John Mark Mobley johnmarkmelanie at gmail.com
Sat Sep 10 00:19:44 EDT 2016


The following math will xor the 8-bits of A with the 8-bits of B.  I think
it is 8-bits.  In assembly its 8-bits.
Q= (NOT A AND B) OR (A AND NOT B)
QN=NOT Q
QN=(NOT A AND NOT B) OR (A AND B)

XOR is used for parity It test for even or odd.  Do you have an even number
of bits or an odd number of bits.

The following math will give a 1-bit answer.
A=1
B=0
Q=(A+B) AND 1
Q=1 if A+B is odd.

John Mark Mobley




More information about the Coco mailing list