ADD adds the value operand to the value of the Accumulator, leaving the resulting value in the Accumulator. The value operand is not affected. ADD function identically. ADD does not add the Carry flag to the result. If the unsigned summed value of the Accumulator, operand exceeds 255 Carry is set. Otherwise, the Carry bit is cleared. If the unsigned summed value of the low nibble of the Accumulator, operand exceeds 15 the Auxillary Carry flag is set. Otherwise, the Auxillary Carry flag is cleared. If the addition of the Accumulator, operand 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.
Syntax : ADD A,operand
Example :
ADD A,#20 => It will add 20 to the value in the accumulator and store the result in the accumulator
ADD A,20h => It will add the value at location 20h with the value in the accumulator and store the result in the accumulator
ADD A,@R0 => It will add the value at the location indicated by R0 regsiter with the value in the accumulator and store the result in the accumulator
ADD A,R5 => It will add the value in the register R5 with the value in the accumulator and store the result in the accumulator
Syntax : ADD A,operand
Example :
ADD A,#20 => It will add 20 to the value in the accumulator and store the result in the accumulator
ADD A,20h => It will add the value at location 20h with the value in the accumulator and store the result in the accumulator
ADD A,@R0 => It will add the value at the location indicated by R0 regsiter with the value in the accumulator and store the result in the accumulator
ADD A,R5 => It will add the value in the register R5 with the value in the accumulator and store the result in the accumulator
- Instruction
- Opcode
- Bytes
- Flags
- ADD A,#data
- 0x24
- 2
- C,AC,OV
- ADD A,iram data
- 0x25
- 2
- C,AC,OV
- ADD A,@R0
- 0x26
- 1
- C,AC,OV
- ADD A,@R1
- 0x27
- 1
- C,AC,OV
- ADD A,R0
- 0x28
- 1
- C,AC,OV
- ADD A,R1
- 0x29
- 1
- C,AC,OV
- ADD A,R2
- 0x2A
- 1
- C,AC,OV
- ADD A,R3
- 0x2B
- 1
- C,AC,OV
- ADD A,R4
- 0x2C
- 1
- C,AC,OV
- ADD A,R5
- 0x2D
- 1
- C,AC,OV
- ADD A,R6
- 0x2E
- 1
- C,AC,OV
- ADD A,R7
- 0x2F
- 1
- C,AC,OV