Email: Password: Remember Me | Create Account (Free)
8051/8052 Instruction: SUBB

Operation:SUBB
Function:Subtract from Accumulator With Borrow
Syntax:SUBB A,operand

InstructionsOpCodeBytesCyclesFlags
SUBB A,#data0x9421C, AC, OV
SUBB A,iram addr0x9521C, AC, OV
SUBB A,@R00x9611C, AC, OV
SUBB A,@R10x9711C, AC, OV
SUBB A,R00x9811C, AC, OV
SUBB A,R10x9911C, AC, OV
SUBB A,R20x9A11C, AC, OV
SUBB A,R30x9B11C, AC, OV
SUBB A,R40x9C11C, AC, OV
SUBB A,R50x9D11C, AC, OV
SUBB A,R60x9E11C, AC, OV
SUBB A,R70x9F11C, AC, OV


Description: SUBB subtract the value of operand from the value of the Accumulator, leaving the resulting value in the Accumulator. The value operand is not affected.

The Carry Bit (C) is set if a borrow was required for bit 7, otherwise it is cleared. In other words, if the unsigned value being subtracted is greater than the Accumulator the Carry Flag is set.

The Auxillary Carry (AC) bit is set if a borrow was required for bit 3, otherwise it is cleared. In other words, the bit is set if the low nibble of the value being subtracted was greater than the low nibble of the Accumulator.

The Overflow (OV) bit is set if a borrow was required for bit 6 or for bit 7, but not both. In other words, the subtraction of two signed bytes resulted in a value outside the range of a signed byte (-128 to 127). Otherwise it is cleared.

See Also: ADD, ADDC, DEC, Instruction Set