MICROPROCESSOR 8085A PROGRAM | WRITE A 8085 ASSEMBLY LANGUAGE PROGRAM TO COPY DATA FROM ONE 16 BIT LOCATION TO ANOTHER LOCATION AND THE VALUE WILL STORED INTO ANOTHER MEMORY LOCATION.

5 Likes Comment

WRITE A 8085 ASSEMBLY LANGUAGE PROGRAM TO COPY DATA FROM ONE 16 BIT LOCATION TO ANOTHER LOCATION AND THE VALUE WILL STORED INTO ANOTHER MEMORY LOCATION.

THEORY :    

  In the 8085 microprocessor, We will perform the data copy operation. To copy we need one memory address with a defined 8-bit value and another memory location to store that value.

ALGORITHM :

Step 1: MVI H,0Ah; to load the value in register H, it is used to store iteration value.

Step 2: LXI B,2000h; to point source memory location, register pair B-C is initialized.

Step 3: LXI D,2100h; to point destination memory location, register pair D-E is initialized.

Step 4: LDAX B; to load the accumulator from the memory location pointed by B-C register pair.

Step 5: STAX D; to store the accumulator content into the memory location pointed by D-E register pair.

Step 6: INX B; to increment the value by 1 for the B-C register pair.

Step 7: INX D;  to increment the value by 1 for the D-E register pair.

Step 8: DCR H; to decrement the value by 1 for the H-L register pair.

Step 9: JNZ (loop); to jump on non zero to loop address (step 4)

 IMPLEMENTATION :

LocationMnemonicsHex Code
3000 MVI H, 26
30010Ah0A
3002LXI B01
30030000
30042020
3005LXI D11
30060000
30072121
3008LDAX B0A
3009STAX D12
300AINX B03
300BINX D13
300CDCR H25
300DJNZC2
300E0808
300F3030
3010HLT76

INPUT AND OUTPUT :

LocationInput
200001
200103
200205
200307
200409
200500
200602
200704
200806
200908
LocationOutput
210001
210103
210205
210307
210409
210500
210602
210704
210806
210908

DISCUSSION :
In this program, We perform a task where we have seek total number of iteration by MVI H,0Ah. Then we set B-C register pair for taking all the value of that series and D-E  register pair is also loaded for storing the information set. Then we perform the loop, within loop we read the value of B-C register pair to store D-E register pair and also increment the value of B-C and D-E register pair. and decrementing the value of H-L register pair by 1. And now when the H-L pair value will be zero then terminate from loop and stop the program.

YOU MIGHT LIKE:

You might like

Saif

About the Author: Saif

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami