Xilinx UG129 Answering Machine User Manual


 
118 www.xilinx.com PicoBlaze 8-bit Embedded Microcontroller
UG129 (v1.1.2) June 24, 2008
Appendix : PicoBlaze Instruction Set and Event Reference
R
XOR sX, Operand — Logical Bitwise XOR Register sX with
Operand
The XOR instruction performs a bitwise logical XOR operation between two operands, as
shown in Figure C-13. The first operand is any register, which also receives the result of the
operation. A second operand is also any register or an 8-bit immediate constant. The ZERO
flag is set if the resulting value is zero. The CARRY flag is always cleared by an XOR
instruction.
The XOR operation inverts bits contained in a register, which is used in forming control
signals.
Examples
XOR sX, sY ; Logically XOR the individual bits of register sX with
; the corresponding bits in register sY
XOR sX, kk ; Logically XOR the individual bits of register sX with
; the corresponding bits in the immediate constant kk
Pseudocode
; logically XOR the corresponding bits in sX and the Operand
for (i=0; i<= 7; i=i+1)
{
sX(i) Å sX(i) XOR Operand(i)
}
CARRY Å 0
if (sX = 0) then
ZERO Å 1
else
ZERO Å 0
end if
PC Å PC + 1
Registers/Flags Altered
Registers: sX, PC
Flags: ZERO, CARRY is always 0
Figure C-13: XOR Operation
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
Register sX
Register sY
Literal kk
UG129_aC_08_051604