Saturday, June 29, 2013

Write a program in 8-bit to move the content from 1004-1009 to 2004-2009.



LXI D, 2004H …………..[store 20h in D and 04h in E]
LXI H, 1004H……………[store 10h in H and 04h in L]
MVI C, 06H………………[since there are 6 values to be moved, counter is set to 06H]
ABC:       ………………….[label name]
  MOV A, M …………….[move the content of M in a, where M contains the value of the address in HL]
  STAX D …..…………….[ store the value of accumulator in the address specified by the register pair DE]
  INR D ……………………[Increase the value of DE by 1]
  INR H……………………[Increase the value of HL by 1]
  DCR C…………………..[Decrease register C by 1]
JNZ ABC ………………..[jump to label ABC if content of C is not zero]
HLT  ……………………..[Stop processing]

No comments:

Post a Comment