R

Chapter 3: PicoBlaze Instruction Set

Processing Data

All data processing instructions operate on any of the 16 general-purpose registers. Only the data processing instructions modify the ZERO or CARRY flags as appropriate for the instruction. The data processing instructions consists of the following types:

Logic instructions

Arithmetic instructions

Test and Compare instructions

Shift and Rotate instructions

Logic Instructions

The logic instructions perform a bitwise logical AND, OR, or XOR between two operands. The first operand is a register location. The second operand is either a register location or a literal constant. Besides performing pure AND, OR, and XOR operations, the logic instructions provide a means to:

complement or invert a register

clear a register

set or clear specific bits within a register

Bitwise AND, OR, XOR

All logic instructions are bitwise operations. The AND operation, illustrated in Figure 3-1, shows that corresponding bit locations in both operands are logically ANDed together and the result is placed back into register sX. If the resulting value in register sX is zero, then the ZERO flag is set. The CARRY flag is always cleared by a logic instruction.

AND sX, sY

AND sX, kk

Register sY Literal kk

Register sX

7

7

6

6

5

5

4

4

3

3

2

2

1

1

0

0

UG129_c3_01_051204

Figure 3-1:Bitwise AND Instruction

The OR and XOR instructions are similar to the AND instruction illustrated in Figure 3-1except that they perform an OR or XOR logical operation, respectively.

See also:

“AND sX, Operand — Logical Bitwise AND Register sX with Operand,” page 93

“OR sX, Operand — Logical Bitwise OR Register sX with Operand,” page 103

“XOR sX, Operand — Logical Bitwise XOR Register sX with Operand,” page 118

24

www.xilinx.com

PicoBlaze 8-bit Embedded Microcontroller

 

 

UG129 (v1.1.2) June 24, 2008

Page 24
Image 24
Xilinx UG129 manual Processing Data, Logic Instructions, PicoBlaze Instruction Set