0% found this document useful (0 votes)
101 views2 pages

Microprocessor 8085 Appendix A

This document provides an explanation, algorithm, flowcharts, and programs to exchange the contents of two memory locations (D000H and D001H) in an 8085 microprocessor. The algorithm has 7 steps: 1) Load D000H into the accumulator, 2) Copy it to register B, 3) Load D001H into the accumulator, 4) Store it in D000H, 5) Copy register B back to the accumulator, 6) Store the accumulator in D001H, 7) Stop. The programs demonstrate three ways to accomplish this exchange using LDA, STA, MOV, XCHG, and other 8085 instructions.

Uploaded by

manpreet kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views2 pages

Microprocessor 8085 Appendix A

This document provides an explanation, algorithm, flowcharts, and programs to exchange the contents of two memory locations (D000H and D001H) in an 8085 microprocessor. The algorithm has 7 steps: 1) Load D000H into the accumulator, 2) Copy it to register B, 3) Load D001H into the accumulator, 4) Store it in D000H, 5) Copy register B back to the accumulator, 6) Store the accumulator in D001H, 7) Stop. The programs demonstrate three ways to accomplish this exchange using LDA, STA, MOV, XCHG, and other 8085 instructions.

Uploaded by

manpreet kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Microprocessor 8085

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

:
:
:
:
:
:

Load the accumulator with the contents of memory location D000 H.


Copy the contents of accumulator to the register B.
Load the accumulator with the contents of memory location D001 H.
Store the contents of accumulator to memory location D000 H.
Copy the contents of register B to the accumulator.
Store the contents of accumulator to memory
location D001 H.
Step VII : Stop.

Flowchart : Refer Flowchart 2 and Flowchart 3.

Program I :

Instruction

Comment

LDA D000 H ; Load data from one memory location


MOV B, A
; Store it in B reg.
LDA D001 H ; Load data from second
; memory location
STA 2000 H ; Store data of second
; memory location to first
; memory location.
MOV A, B
; Recall data of first location
STA 2001 H ; Store it in second memory location
HLT
; Stop

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

You might also like