ADD-ADDC

Description:

ADD and ADDC both add the value operand to the value of the Accumulator, leaving the resulting value in the Accumulator. The value operand is not affected. ADD and ADDC function identically except that ADDC adds the value of operand as well as the value of the Carry flag whereas ADD does not add the Carry flag to the result.

Operation:ADD, ADDC
Function:Add Accumulator, Add Accumulator With Carry
Syntax:ADD A,operand
ADDC A,operand
InstructionsOpCodeBytesCyclesFlags
ADD A,#data0x2421C, AC, OV
ADD A,iram addr0x2521C, AC, OV
ADD A,@R00x2611C, AC, OV
ADD A,@R10x2711C, AC, OV
ADD A,R00x2811C, AC, OV
ADD A,R10x2911C, AC, OV
ADD A,R20x2A11C, AC, OV
ADD A,R30x2B11C, AC, OV
ADD A,R40x2C11C, AC, OV
ADD A,R50x2D11C, AC, OV
ADD A,R60x2E11C, AC, OV
ADD A,R70x2F11C, AC, OV
InstructionsOpCodeBytesCyclesFlags
ADDC A,#data0x3421C, AC, OV
ADDC A,iram addr0x3521C, AC, OV
ADDC A,@R00x3611C, AC, OV
ADDC A,@R10x3711C, AC, OV
ADDC A,R00x3811C, AC, OV
ADDC A,R10x3911C, AC, OV
ADDC A,R20x3A11C, AC, OV
ADDC A,R30x3B11C, AC, OV
ADDC A,R40x3C11C, AC, OV
ADDC A,R50x3D11C, AC, OV
ADDC A,R60x3E11C, AC, OV
ADDC A,R70x3F11C, AC, OV

The Carry bit (C) is set if there is a carry-out of bit 7. In other words, if the unsigned summed value of the Accumulator, operand and (in the case of ADDC) the Carry flag exceeds 255 Carry is set. Otherwise, the Carry bit is cleared.

The Auxillary Carry (AC) bit is set if there is a carry-out of bit 3. In other words, if the unsigned summed value of the low nibble of the Accumulator, operand and (in the case of ADDC) the Carry flag exceeds 15 the Auxillary Carry flag is set. Otherwise, the Auxillary Carry flag is cleared.

The Overflow (OV) bit is set if there is a carry-out of bit 6 or out of bit 7, but not both. In other words, if the addition of the Accumulator, operand and (in the case of ADDC) the Carry flag treated as signed values results in a value that is out of the range of a signed byte (-128 through +127) the Overflow flag is set. Otherwise, the Overflow flag is cleared.



User Comments

No Posts found !

Login to Post a Comment.