Advertisement Remove all ads

Write a Assembly Language Program to copy a block of data having starting address 4500 H to new location starting from 4600 H. The length of block is stored at memory location 44FF H. - Computer Science 2

Write a Assembly Language Program to copy a block of data having starting address 4500 H to new location starting from 4600 H. The length of block is stored at memory location 44FF H.

Advertisement Remove all ads

Solution

Label Mnemonics Comments
  LXI H, 44FFH ; Load HL pair with 44FFH
  LXI D, 4600H ; starting address of destination
  MOV C, M ; Move count in Reg. C
  INX H ; Increment HL Pair
LOOP : MOV A, M ; Transfer memory to Acc.
  STAX D ; Store Acc. to new location
  INX H ; Increment HL pair
  INX D ; Increment DE pair
  DCR C ; Decrement count
  JNZ LOOP ; Jump to LOOP if count is not zero
  RST 1.0 ; Restart
Concept: Instruction Set and Programming of 8085
  Is there an error in this question or solution?
Advertisement Remove all ads

APPEARS IN

Advertisement Remove all ads
Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×