WAP to demonstrate block transfer of data.


Program to demonstrate block transfer of data.

Three bytes of data stored from 40 H is to be copied to other location starting from 6000H.

For this program we need two registers to store starting locations of source and destination.

Lets say, we take RP as source  and DPTR as destination registers.


Now we need a counter to count 3 bytes of data to be transferred. It is not possible to transfer data from one register to another directly.

So we need  an accumulator to stand in between as a temporary register.

Three steps for initialization are as follows
àInitialize r0 and DPTR with source and destination address respectively.
àInitialize counter R2 withy value 04H.
àCopy content of R0 to Reg B.
àCopy content of R0 to ACCUMULATOR.
à Copy content of accumulator to DPTR.
àIncrement R and DPTR by 1.
àRepeat same steps 2 more times.

Comments