8085 Program - Exchanging Data

Q. Write an assembly language program to exchange the content of memory locations 5000H and 8000H with a labeled Address and opcode. Also stepwise show the result.

Program:

Address
Mnemonics
Operand
Hex Code
Remarks
2000H
LXI H,
5000H
Hex code of LXI H

2001H


00
HL=5000H
2002H


50
M=[HL]=[5000H]
2003H
LXI D,
8000H
Hex code of LXI D

2004H


00

2005H


80
DL=8000H
2006H
LDAX D

Hex code of LDAX D
A=[DL]=[8000H]
2007H
MOV B,A

Hex code of MOV B,A
B=A
2008H
MOV A,M

Hex code of MOV A,M
A=M
2009H
STAX D

Hex code of STAX D
[8000H]=M
200AH
MOV M,B

Hex code of MOV M,B
M=[8000H]
200BH
HLT

76
Stop

1 comment: