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.
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.
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)
INPUT AND OUTPUT :
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: