XOR

Instruction: Bitwise XOR two values.

XOR Value1, < # > Value2


Result: Value1 XOR Value2 is stored in Value1.

  • Value1 (d-field) is the register containing the value to bitwise XOR with Value2 and is the destination in which to write the result.
  • Value2 (s-field) is a register or a 9-bit literal whose value is bitwise XORed with Value1.

Opcode Table:

–INSTR– ZCRI  –CON–    –DEST–         –SRC–

Z Result

C Result

Result

Clocks

 011011    001i    1111    ddddddddd    sssssssss

Result = 0

Parity of Result

Written

4

Concise Truth Table:

In

Out

Destination

Source

Z

C

Effects

Destination

Z

C

$0000_000A; 10

$0000_0005; 5

-

-

wz wc

$0000_000F; 15

0

0

$0000_000A; 10

$0000_0007; 7

-

-

wz wc

$0000_000D; 13

0

1

$0000_000A; 10

$0000_000A; 10

-

-

wz wc

$0000_0000; 0

1

0

$0000_000A; 10

$0000_000D; 13

-

-

wz wc

$0000_0007; 7

0

1

$0000_000A; 10

$0000_000F; 15

-

-

wz wc

$0000_0005; 5

0

0

Explanation

XOR (bitwise exclusive OR) performs a bitwise XOR of the value in Value2 into that of Value1.

If the WZ effect is specified, the Z flag is set (1) if Value1 XOR Value2 equals zero. If the WC effect is specified, the C flag is set (1) if the result contains an odd number of high (1) bits. The result is written to Value1 unless the NR effect is specified.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.