Xilinx UG129 Answering Machine User Manual


 
PicoBlaze 8-bit Embedded Microcontroller www.xilinx.com 115
UG129 (v1.1.2) June 24, 2008
SUBCY sX, Operand —Subtract Operand from Register sX with Borrow
R
Description
Operand and CARRY flag are subtracted from register sX. The ZERO and CARRY flags are
set appropriately.
Pseudocode
if (CARRY = 1) then
sX Å (sX - Operand – 1) mod 256; always an 8-bit result
else
sX Å (sX – Operand) mod 256 ; always an 8-bit result
endif
if ( (sX - Operand – CARRY) < 0 ) then
CARRY Å 1
else
CARRY Å 0
endif
if ( ((sX - Operand - CARRY) = 0) or ((sX - Operand - CARRY) = -256) )
then
ZERO Å 1
else
ZERO Å 0
endif
PC Å PC + 1
Registers/Flags Altered
Registers: sX
Flags: CARRY, ZERO
Notes
pBlazIDE Equivalent: SUBC