A + B = A XOR B + 2(A AND B) (take my word for it)
So A XOR B = A + B - 2(A AND B)
The ST6 can only do arithmetic on a single register, so it is easier to evaluate this if it is arranged
A XOR B = -(2(A AND B) - A - B).
Writing this in a form the assembler can deal with gives
STA temp AND B ADD A SUB temp SUB B DEC A COM AI like to end this with DEC/COM instead of the more usual COM/INC partly because it confuses people, and partly because you can get XNOR by simply chopping the last instruction.