Xilinx UG129 Answering Machine User Manual


 
PicoBlaze 8-bit Embedded Microcontroller www.xilinx.com 103
UG129 (v1.1.2) June 24, 2008
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.
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
Figure C-6: OR 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_07_051604