0% found this document useful (0 votes)
39 views

Microprocessor 8085 Appendix A

The document describes the algorithm and 8085 assembly program for moving a block of data from one memory location to another. It initializes registers to store the source and destination addresses and number of bytes to move. It then copies each byte from the source to destination, incrementing both pointers, until the byte count reaches zero.

Uploaded by

manpreet kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Microprocessor 8085 Appendix A

The document describes the algorithm and 8085 assembly program for moving a block of data from one memory location to another. It initializes registers to store the source and destination addresses and number of bytes to move. It then copies each byte from the source to destination, incrementing both pointers, until the byte count reaches zero.

Uploaded by

manpreet kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Microprocessor 8085

Appendix A

Explanation :

Consider that a block of data of N bytes is present at source location. Now this block of N bytes is to
be moved from source location to a destination location.
Let the number of bytes N = 10.
We will have to initialize this as count in the C register.
We know that source address is in the HL register and destination address is in the DE register.
Get the byte from source memory block and store the byte in the destination memory block.
Transfer data byte by byte from source to destination block till all the bytes are transferred.

Algorithm :

Step I
Step II

: Initialize the register C with count.


: Initialize HL and DE with source
and destination address.
Step III : Get the byte from source memory block.
Step IV : Transfer the data to destination block.
Step V
: Increment source memory pointer
Step VI : Increment destination memory pointer.
Step VII : Decrement Count.
Step VIII : Check for count in C,
if not zero goto step III
Step IX : Stop.

Flowchart : Refer flowchart 20.

Program :
Instruction

Comment

MVI C, 0AH
LXI H, D000H

;
;
;
;
;

LXI

D, E000H

BACK: MOV

A, M

STAX D

INX H
INX D
DCR C
JNZ BACK
HLT

;
;
;
;
;
;
;
;
;
;
;

Initialize counter
Initialize source
memory pointer
Initialize destination
memory pointer
; Get byte from source
memory block
Store byte in the
destination
memory block
Increment source
memory pointer
Increment destination
memory pointer
Decrement counter
If counter 0 repeat
Terminate program execution

Flowchart 20

You might also like