R
Appendix : PicoBlaze Instruction Set and Event Reference
Pseudocode
sX Å (sX + Operand) mod 256; always an
if ( (sX + Operand) > 255 ) then
CARRY Å 1 else
CARRY Å 0 endif
if ( ((sX + Operand) = 0) or ((sX + Operand) = 256) ) then
ZERO Å 1 else
ZERO Å 0 endif
PC Å PC + 1
Registers/Flags Altered
Registers: sX, PC
Flags: CARRY, ZERO
ADDCY sX, Operand —Add Operand to Register sX with Carry
The ADDCY instruction performs an addition of two
| Register sY or |
| Literal kk |
Carry Out | Carry In |
CARRY | Register sX |
| UG129_aC_02_051604 |
Figure |
Example
Operand is a register location, sY, or an immediate
ADDCY sX, sY; Add register. sX = sX + sY + CARRY
ADDCY sX, kk; Add immediate. sX = sX + kk + CARRY
Description
Operand and CARRY flag are added to register sX. The ZERO and CARRY flags are set appropriately.
92 | www.xilinx.com | PicoBlaze |
UG129 (v1.1.2) June 24, 2008