Computer Science, asked by swaroopreddy0880, 6 hours ago

Write a program in 8086 to move hundred bytes of data from the offset address 3000H in the segment 4000H​

Answers

Answered by Wethselodebbarma
0

Explanation:

8086 program to transfer a block of bytes by using string instruction

Problem – Write an assembly language program to transfer a block of bytes from one memory location to another memory location by using string instruction.

Example –

Example –

In this example, the counter value stored in CX register is 4.

The block of data which is stored from memory location starting from 501 to 504 offset is transferred to another memory location which is starting from 600 to 603 offset.

Assumptions –

The value of counter which tells the number of bytes to be transferred is stored at offset 500.

The 8-bit data which have to be transfer is stored in continuous memory location starting from 501.

The data is transferred to a continuous memory location starting from 600.

The value of DS and ES is taken equal to 0000.

the program starts from offset 400.

CLD instruction is used to clear the directional flag, i.e., DF=0. Now, value of SI and DI will be increased.

Algorithm –

set the value of offset SI equal to 500.

set the value of offset DI equal to 600.

load the value 0000 into register AX.

load the data of AX register into DS(data segment).

load the data of AX register into ES(extra segment).

load the data of offset SI into CL register and load value 00 into CH register.

increment the value of SI by one.

clear the directional flag so that data is read from lower memory to higher memory location.

check the value of CX, if not equal to zero then repeat step 10 otherwise go to step 11.

transfer the data from source memory location to destination memory location and decrease the value of CX by one.

Stop.

Similar questions