-2

enter image description here

here is the programming card : https://files.fm/u/7pfmqca9

Why is LEA 0x89AB(%A0),%A0 an Illegal Instruction in 68000 assembly?

prl
  • 11,716
  • 2
  • 13
  • 31
Andrew
  • 42
  • 8
  • 1
    It seems you have mistaken x86 for `m68k` (Motorola 68000). They are different in plenty of details. Register A0 is from m68k but not x86. – Netch Apr 17 '18 at 05:48
  • 1
    @Netch: m68k has an LEA instruction with the same mnemonic as x86. [Difference between LEA and MOVE.L?](//stackoverflow.com/q/10740222) – Peter Cordes Apr 17 '18 at 08:07
  • 1
    @PeterCordes see question edit history: it was initially containing "86" in all text. That's why I noticed wrong register. – Netch Apr 17 '18 at 09:55

1 Answers1

2

Based on the examples given, I infer that a 16-bit immediate is sign extended. From that, I would guess that the 16-bit offset in the indexed addressing mode is also signed. Thus, 0x89ab is an invalid offset, because it doesn't fit in a 16-bit signed number.

prl
  • 11,716
  • 2
  • 13
  • 31