0

Okay so I have the following instruction:

MOVE.W $1234, $8000

Now I'm confused whether the addressing mode for $1234 and $8000 is absolute short or absolute long.

I would also really appreciate it if someone can explain how to distinguish between absolute short and absolute long. Thanks.

Sid
  • 1
  • 1
  • Note that if you use absolute short addressing for `$8000`, you'd end up with the address `$FFFF8000` since the address is sign-extended. That might be what you want, or it might not be. – Michael Oct 26 '15 at 10:33
  • @Michael So if I wanted the address to be $00008000 I'd use absolute long? Also what about $1234? – Sid Oct 26 '15 at 10:45

2 Answers2

4

Use a suffix .L or .W to indicate long or short. In the assemblers I've used, absolute long was the default. Other assemblers might use absolute short if the address fits in 16 bits.

E.g.

# Move word from memory location 00001234 to 00008000.
MOVE.W $1234.W, $8000.L

# From 00001234 to FFFF8000.
MOVE.W $1234.L, $8000.W
Lars Brinkhoff
  • 13,542
  • 2
  • 28
  • 48
1

Absolute short/long refers to address register addresses. Absolute short addresses are always sign-extended from 16-bit to 32-bit values (ex 0xEDCB.w -> 0xFFFFEDCB) when 68k reads the instructions. It takes less time and less space to use absolute short addressing over absolute long, however only -0x8000-0x7FFF (0xFFFF8000-0x00007FFFF) can be absolute short, in any other case absolute long must be used. If you aren't fuzzed about space and speed however, you may completely neglect this and let your assembler decide. If its smart enough (which often isn't the case) it would decide for you if not marked either.

Green Snake
  • 76
  • 1
  • 9