ADDC adds the value operand to the value of the Accumulator and Carry flag, leaving the resulting value in the Accumulator. The value operand is not affected. ADDC adds the value of operand as well as the value of the Carry flag. If the addition of the Accumulator, operand and 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. If the unsigned summed value of the low nibble of the Accumulator, operand and the Carry flag exceeds 15 the Auxillary Carry flag is set. Otherwise, the Auxillary Carry flag is cleared. If the unsigned summed value of the Accumulator, operand and the Carry flag exceeds 255 Carry is set. Otherwise, the Carry bit is cleared.
Syntax : ADDC A,operand
Example :
ADDC A,#20 => It will add 20 to the value in the accumulator and the carry flag and store the result in the accumulator
ADDC A,20h => It will add the value at location 20h with the value in the accumulator and the carry flag and store the result in the accumulator
ADDC A,@R0 => It will add the value at the location indicated by R0 regsiter with the value in the accumulator and the carry flag and store the result in the accumulator
ADDC A,R5 => It will add the value in the register R5 with the value in the accumulator and the carry flag and store the result in the accumulator
Syntax : ADDC A,operand
Example :
ADDC A,#20 => It will add 20 to the value in the accumulator and the carry flag and store the result in the accumulator
ADDC A,20h => It will add the value at location 20h with the value in the accumulator and the carry flag and store the result in the accumulator
ADDC A,@R0 => It will add the value at the location indicated by R0 regsiter with the value in the accumulator and the carry flag and store the result in the accumulator
ADDC A,R5 => It will add the value in the register R5 with the value in the accumulator and the carry flag and store the result in the accumulator
- Instruction
- Opcode
- Bytes
- Flags
- ADDC A,#data
- 0x34
- 2
- C,AC,OV
- ADDC A,iram data
- 0x35
- 2
- C,AC,OV
- ADDC A,@R0
- 0x36
- 1
- C,AC,OV
- ADDC A,@R1
- 0x37
- 1
- C,AC,OV
- ADDC A,R0
- 0x38
- 1
- C,AC,OV
- ADDC A,R1
- 0x39
- 1
- C,AC,OV
- ADDC A,R2
- 0x3A
- 1
- C,AC,OV
- ADDC A,R3
- 0x3B
- 1
- C,AC,OV
- ADDC A,R4
- 0x3C
- 1
- C,AC,OV
- ADDC A,R5
- 0x3D
- 1
- C,AC,OV
- ADDC A,R6
- 0x3E
- 1
- C,AC,OV
- ADDC A,R7
- 0x3F
- 1
- C,AC,OV