COPY DATA

 

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.

DATA COPY FROM ONE LOCATION TO ANOTHER
DATA COPY FROM ONE LOCATION TO ANOTHER

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
RAM SLOTS
RAM SLOTS

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.

Microprocessor Interaction Diagram
Microprocessor Interaction Diagram

YOU MIGHT LIKE:

https://www.shoutcoders.com/calculate-the-sum-of-series-of-numbers-with-carry-mp-8085a/?preview_id=1729&preview_nonce=4a4bb6539a&preview=true&_thumbnail_id=1937
MP 8085A PROGRAM | CALCULATE THE SUM OF SERIES OF NUMBERS WITH CARRY WITH DISCUSSION

FAQ :

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:

fig: XOR & XNOR GATE: TRUTH TABLE & SYMBOL.

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.

Comments

Popular posts from this blog

MEMORY MANAGEMENT NOTE

MULTIPLY WITHOUT CARRY

SUBTRACTION