aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/msp430/words/swap.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/msp430/words/swap.asm')
-rw-r--r--amforth-6.5/msp430/words/swap.asm6
1 files changed, 6 insertions, 0 deletions
diff --git a/amforth-6.5/msp430/words/swap.asm b/amforth-6.5/msp430/words/swap.asm
new file mode 100644
index 0000000..7950f18
--- /dev/null
+++ b/amforth-6.5/msp430/words/swap.asm
@@ -0,0 +1,6 @@
+;C XT_SWAP x1 x2 -- x2 x1 swap top two items
+ CODEHEADER(XT_SWAP,4,"swap")
+ MOV @PSP,W ; 2
+ MOV TOS,0(PSP) ; 4
+ MOV W,TOS ; 1
+ NEXT ; 4