aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/avr8/words/minus.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/avr8/words/minus.asm')
-rw-r--r--amforth-6.5/avr8/words/minus.asm17
1 files changed, 17 insertions, 0 deletions
diff --git a/amforth-6.5/avr8/words/minus.asm b/amforth-6.5/avr8/words/minus.asm
new file mode 100644
index 0000000..e1922ce
--- /dev/null
+++ b/amforth-6.5/avr8/words/minus.asm
@@ -0,0 +1,17 @@
+; ( n1|u1 n2|u2 -- n3|u3 )
+; Arithmetics
+; subtract n2 from n1
+VE_MINUS:
+ .dw $ff01
+ .db "-",0
+ .dw VE_HEAD
+ .set VE_HEAD = VE_MINUS
+XT_MINUS:
+ .dw PFA_MINUS
+PFA_MINUS:
+ ld temp0, Y+
+ ld temp1, Y+
+ sub temp0, tosl
+ sbc temp1, tosh
+ movw tosl, temp0
+ jmp_ DO_NEXT