Category:68000 Assembly: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) m (→The Stack) |
||
Line 85: | 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>: |
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> |
<lang 68000devpac>MOVE.W D0,-(SP) ;push #$3344 onto the stack |
||
MOVE.W D0,-(SP) ;push #$3344 onto the stack |
|||
MOVE.B (SP)+,D0 ;pop them in the order #$44 #$33.</lang> |
MOVE.B (SP)+,D0 ;pop them in the order #$44 #$33.</lang> |
||