Category:68000 Assembly: Difference between revisions
m
→The Stack
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) m (→The Stack) |
||
Line 85:
You can abuse this property of the stack to quickly swap bytes around. Suppose you had a number like <code>#$11223344</code> stored in <code>D0</code> and you wanted to change it to <code>#$11224433</code>:
<lang 68000devpac>MOVE.W D0,-(SP) ;push #$3344 onto the stack
MOVE.B (SP)+,D0 ;pop them in the order #$44 #$33.</lang>
|