Jump to content

Category:68000 Assembly: Difference between revisions

m
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, andwhich takes less bytes to encode than the long length version.
 
<lang 68000devpac>MOVEA.W #$8000,A4 ;A4 = #$FFFF8000. Remember the top byte is ignored so this is the same as #$00FF8000.
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.