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:
Which command is used to transfer the data from external memory to the accumulator?
In 8085 Instruction set, MOV r, M is an instruction where the 8-bit data content of the memory location as pointed by HL register pair will be moved to the register r. … It occupies only 1-Byte in memory. MOV E, M is an example instruction of this type. It is a 1-Byte instruction.
Which flag is affected by MOV instruction?
The MOV instruction never affects the flags. Whenever the destination operand equals Zero, the Zero flag is set.
What is the full form of XRI instruction and it’s usage?
The full form of XRI instruction is X-OR Immediate. It is used for binary X-OR operation ( Logical OR operation). The table of X-OR is given below:
What is the full form of XRA R instruction and it’s usage?
The full form of XRA instruction is “XOR ACCUMULATOR” and R stands for any of the following registers, memory location pointed by HL register pair.
R= A,B,C,D,E,H,L,or M
This instruction is used to XOR contents of R with the ACCUMULATOR. The result of XOR operation will be stored in the Accumulator.