Statement: Write an ALP to exchange the 16 bit data stored in register BC & register DE (with & without XCHG)
LXI B,1122H (it can be any data)
LXI D,1221H(it can be any data)
MOV H,D
MOV L,E
MOV D,B
MOV E,C
MOV B,H
MOV C,L
HLT
With XCHG:-
LXI B,1122H( it can be any data)
LXI D,1221H ( it can be any data)
MOV H,B
MOV L,C
MOV B,D
MOV C,E
XCHG
HLT
No comments:
Post a Comment