0

I am using 68HC11. I need to transfer content of the memory:

  • content of $0098 to $0011
  • content of $0097 to $0010

But there is a limitation so I can not solve this. I have to use at most two instructions for this.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

1 Answers1

1
LDD $0097
STD $0010

or

LDX $0097
STX $0010

or

LDY $0097
STY $0010

So, just use a 16-bit instruction to do the copy.

tonypdmtr
  • 3,037
  • 2
  • 17
  • 29
  • thanks sir but this is for just one transfer. ı need 2 instructıon for 2 transfer ( 2 ınstructıon for content of $0098 to $0011 content of $0097 to $0010 these ) – Kamil Şahin May 26 '20 at 13:43
  • No, these are 16-bit instructions, they each read and write two consecutive bytes at a time. Your source and destination are 16-bit in consecutive addresses. – tonypdmtr May 26 '20 at 14:54
  • ı understand now. these are consecutive bytes bcs of 16-bit instructıon. so ıt can work on both adresses., am ı rıght , sir ? – Kamil Şahin May 26 '20 at 20:10
  • Yes. `LDD` (for example) will place the first byte in register A, and the second one in B. – tonypdmtr May 26 '20 at 20:30