CH 2 - Arithmetic Instruction Group
CH 2 - Arithmetic Instruction Group
00111010 = 3A H
Memory
D000 35 H
• Instruction: ADD M
• After execution: A = 3AH
• Instruction length: 1- byte
• Addressing mode: Register Indirect Addressing mode
• Flags affected : All
3) ADI 8-bit data
• This instruction adds the 8-bit immediate data specified in second byte of instruction
to the content of accumulator.
• The result is placed in accumulator.
• Let [A] = 05H
• Instruction: ADI 35H
• After execution: A = 3AH
• Instruction length: 2- byte
• Addressing mode: Immediate Addressing mode
• Flags affected : All
4) ADC r
• This instruction adds the content of register and the carry flag to the content of A .
• Instruction: ADC D
Memory
F000 05 H
• Instruction: ADC M
• After execution: A = 3AH
• Instruction length: 1- byte
• Addressing mode: Register Indirect Addressing mode
• Flags affected : All
6) ACI 8-bit data
• This instruction adds the 8-bit immediate data along with the content of carry flag to
the content of accumulator.
• The result is placed in accumulator.
• Let [Cy]=1H and [A]= 05H
• Instruction: ADI 55H
• After execution: A = 5B H
• Instruction length: 2- byte
• Addressing mode: Immediate Addressing mode
• Flags affected : All
7) SUB r
• The content of register r are subtracted from the content of accumulator.
• The result is stored in accumulator.
• Let [A]=50 H & [C]=40 H
• Instruction: ADD D 50H = 0 1 0 1 0 0 0 0
- 40H = 0 1 0 0 0 0 0 0
00010000 = 10 H
Memory
D000 05 H
• Instruction: SUB M
• After execution: A = 02H
• Instruction length: 1- byte
• Addressing mode: Register Indirect Addressing mode
• Flags affected : All
9) SUI 8-bit data
• This instruction subtracts the 8-bit immediate data specified in second byte of
instruction from the content of accumulator.
accumulator
• The result is placed in accumulator.
• Let [A] = 1FH
• Instruction: SUI 1FH
• After execution: A = 00H
• Instruction length: 2- byte
• Addressing mode: Immediate Addressing mode
• Flags affected : All
10) SBB r
• This instruction subtracts the content of register r and the carry flag from the content of
Accumulator .
• Instruction: SBB D
Memory
F000 05 H
• Instruction: SBB M
• After execution: A = 02H
• Instruction length: 1- byte
• Addressing mode: Register Indirect Addressing mode
• Flags affected : All
12) SBI 8-bit data
• This instruction subtracts the 8-bit immediate data along with the content of carry flag
from the content of accumulator.
• The result is placed in accumulator.
• Let [Cy]= 0 and [A]= 07H
• Instruction: SBI 05H
• After execution: A = 02 H
• Instruction length: 2- byte
• Addressing mode: Immediate Addressing mode
• Flags affected : All
13) INR r
• The content of register r are incremented by one.
• The result is stored in the same place.
• The register r can be A, B, C, D, E, H and L.
• Let [A]= 07H
• Instruction: INR A
• After execution: A = 08 H
• Instruction length: 1- byte
• Addressing mode: Register Addressing mode
• Flags affected : All flags except carry flag may be affected.
14) INR M
• The content of memory location, whose address is stored in H-L pair is incremented by
one.
• The result is placed in the same place.
• Let HL = D000H
Memory
D000 05 H
• Instruction: INR M
• After execution: A = 06H
• Instruction length: 1- byte
• Addressing mode: Register Indirect Addressing mode
• Flags affected : All flags except carry flag may be affected.
15) INX Rp
• The content of register pair Rp are incremented by one.
• The result is stored in the same place.
• Let [HL]= C000H
• Instruction: INX H
• After execution: HL = C001 H
• Instruction length: 1- byte
• Addressing mode: Register Addressing mode
• Flags affected : None.
16) DCR r
• The content of register r is decremented by one.
• The result is stored in the same place.
• The register r can be A, B, C, D, E, H and L.
• Let [C]= 07H
• Instruction: DCR C.
• After execution: C = 06 H
• Instruction length: 1- byte
• Addressing mode: Register Addressing mode
• Flags affected : All flags except carry flag may be affected.
17) DCR M
• The content of memory location, whose address is stored in H-L pair is decremented by
one.
• The result is placed in the same place.
• Let HL = D000H Memory
D000 05 H
• Instruction: DCR M
• After execution: Memory
D000 04 H