Category:68000 Assembly: Difference between revisions
m
→Length
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) m (→Length) |
||
Line 135:
MOVE.L #0,D3 ;D3 = #$00000000</lang>
Loading immediate values into address registers is different. You can only move words or longer into address registers, and if you move a word, the value is sign-extended. This means that if the top nibble of the word is 8 or greater, the value gets padded to the left with Fs, and is padded with zeroes if the top nibble is 7 or less. If you're adding a constant value less than 7FFF to an address, it's usually safe to use the word length operation,
<lang 68000devpac>MOVEA.W #$8000,A4 ;A4 = #$FFFF8000. Remember the top byte is ignored so this is the same as #$00FF8000.
|