ADD



Syntax: ADD R
Where R can be any of the general purpose registers (A,B,C,D,E,H andL)
Byte: 1byte
Addressing Mode: Register Addressing

Working: 
1. 
2. 
3. 
4. Flag

Example: ADD B 
where [B] = 22H 
and [A]= 11H
After execution of ADD B
[A] = 33H 
[B] = 22H

Program: write an ALP for 8bit addition of values present in Registers A and B where A carries 44H and B carries 30H. Store result at memory location 5000H.

Label  Mnemonics  Comments
Start: ADD B 
          STA 5000H 
 Stop: HLT

Output: [5000H]= 74H



LXI H, 4000H ; 4000= 50h
MOV A,M ; a= 50h
INX H ; 4001h where 4001= 90h
MOV B, M ; b= 90h
ADD B ; a= a+b ... A = 50+90= E0h
INX H ; 4002h
MOV M,A ; 4002h = E0h
HLT
           

Comments