In this program we want to move the contents of block 1 C100
In this program, we want to move the contents of block 1 ($C100 to $C107) to block 2 ($C150 to This means that the contents of $C100 (44H) will move to the contents of $C150 and overwrite them and so on. After executing the program, the contents of the two blocks should be same. Remember, when we write any new data over existing data, the latter will be and replaced by the new data.
Solution
X:points first byte of Block1
Y:points first byte of Block2
Initially X=C100 H & Y=C150H
LDAA 0,X :gets the data from Block1 into accumulator A
STAA 0,Y :Stores the data in Block2
Here Accumulator A has data 40H which is send to Block2
INX:increments X,so X=C101 H
INY:incremetns Y,so Y=C151 H
This process repeats till X reaches end of block that is
X=C107 H [answer]
Y=C157 H [answer]
Data of Block2 from C150H till C157H is overwritten by data of block1.so new data for locations are :
C150 H : 44 H
C151 H : 05 H
C152 H :37 H
C153 H :57 H
C154 H :67 H
C155 H :84 H
C156 H :A7 H
C157 H : B6 H
Till here data is overwritten,after this data will same as previous data of locations,so
C158 H :04 H
C159 H :0A H
