OR sX, Operand — Logical Bitwise OR Register sX with Operand

R

OR sX, Operand — Logical Bitwise OR Register sX with Operand

The OR instruction performs a bitwise logical OR operation between two operands, as shown in Figure C-6. 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 OR 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_07_051604

Figure C-6: OR Operation

The OR instruction provides a way to force the setting any bit of the specified register, which can be used to form control signals.

Examples

OR sX, sY ; Logically OR the individual bits of register sX with the ; corresponding bits in register sY

OR sX, kk ; Logically OR the individual bits of register sX with the ; corresponding bits in the immediate constant kk

Pseudocode

;logically OR the corresponding bits in sX and the Operand for (i=0; i<= 7; i=i+1)

{

sX(i) Å sX(i) OR 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

PicoBlaze 8-bit Embedded Microcontroller

www.xilinx.com

103

UG129 (v1.1.2) June 24, 2008

Page 103
Image 103
Xilinx UG129 manual Or sX, Operand Logical Bitwise or Register sX with Operand