SUB sX, Operand —Subtract Operand from Register sX

KCPSM3 Instruction

PBlazIDE Instruction

STORE sX, (sY)

STORE sX, sY

 

 

R

The STORE instruction is only supported on PicoBlaze microcontrollers for Spartan-3,

Virtex-II, and Virtex-II Pro FPGAs.

SUB sX, Operand —Subtract Operand from Register sX

The SUB instruction performs an 8-bit subtraction of two operands, as shown in

Figure C-9. The first operand is any register, which also receives the result of the operation. The second operand is also any register or an 8-bit constant value. Flags are affected by this operation. The SUB instruction does not use the CARRY as an input, and therefore there is no need to condition the flags before use.

The CARRY flag, when set, indicates when an underflow (borrow) occurred.

 

Register sY or

 

Literal kk

Borrow

 

CARRY

Register sX

 

UG129_aC_03_051604

Figure C-9:

SUB Instruction

Examples

Operand is a register location, sY, or an immediate byte-wide constant, kk.

SUB sX, sY; Subtract register. sX = sX - sY.

SUB sX, kk; Subtract immediate. sX = sX - kk.

Description

Operand is subtracted from register sX. The ZERO and CARRY flags are set appropriately.

PicoBlaze 8-bit Embedded Microcontroller

www.xilinx.com

113

UG129 (v1.1.2) June 24, 2008

Page 113
Image 113
Xilinx UG129 manual SUB sX, Operand -Subtract Operand from Register sX, Store sX, sY