Professional Documents
Culture Documents
Appendix A
Explanation :
We have to exchange the contents of memory locations D000 H and D001 H. Initially we will load
the contents of memory location D000 H to the accumulator.
Store the contents of accumulator in register B.
Now, load the contents of memory location D001 H to the accumulator. Store this number at memory
location D000 H.
Load the stored number in register B back to the accumulator and store the contents of accumulator
to memory location D001 H.
Algorithm :
Step I
Step II
Step III
Step IV
Step V
Step VI
:
:
:
:
:
:
Program I :
Instruction
Comment
Program II :
Instruction
Comment
LHLD D000 H
; Load HL with data at D000 H and D001 H
MOV A, H
; second byte in ACC
MOV H, L
; first byte in H
MOV L, A
; second byte in L
SHLD
D000 H
; Store HL
HLT
; Sto
Flowchart 2
Microprocessor 8085
Appendix A
Flowchart 3
Program III :
Instruction
LXI
H, D000 H
LXI
D, D001 H
MOV B, M
LDAX D
XCHG
MOV M, B
STAX D
HLT
Comment
; HL pointing to D000 H
; DE pointing to D001 H
; B (HL) (first byte)
; Load second byte in ACC.
; Exchange DE and HL pair contents.
; Store first byte in second location
; Store second byte in first location.
; Stop