R

Appendix : PicoBlaze Instruction Set and Event Reference

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.

Register sY Literal kk

Register sX

7

7

6

6

5

5

4

4

3

3

2

2

1

0

1

0

UG129_aC_08_051604

Figure C-13: XOR Operation

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

118

www.xilinx.com

PicoBlaze 8-bit Embedded Microcontroller

 

 

UG129 (v1.1.2) June 24, 2008

Page 118
Image 118
Xilinx UG129 manual XOR sX, Operand Logical Bitwise XOR Register sX with Operand