The YGREC8's Manual : the XOR opcode

Created dim. 29 oct. 2023 23:40:23 CET by whygee@f-cpu.org

PRELIMINARY / WORK IN PROGRESS


Encoding

15141312 111098 7654 3210
0 0 0 1 0 0 N CND3 SRI SND
1 CND2 Imm4
1 IMM8

Description

This opcode takes the SRI operand and computes a boolean exclusive OR (difference) with the SND operand, then writes the result back into SND.

If the destination register (SND unless instructed otherwise by PF) is PC, this performs a jump. But it's pretty dumb.

Effects

XOR affects the Sign and Zero flags but not the Carry.

Forms

This is a core operation that supports all 3 types of operand for SRI:

Examples

XOR R1 R2 ; R2 = R2 ^ R1

XOR 123 R3 ; R3 = R3 ^ 123

; XOR R2 into R1 if external bit 1 is set
XOR R2 R1 IF1

; flip bit 1 of R3 if the last result was positive
XOR 2 R3 IFNS