aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/avr8/words/d-plus.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/avr8/words/d-plus.asm')
-rw-r--r--amforth-6.5/avr8/words/d-plus.asm27
1 files changed, 27 insertions, 0 deletions
diff --git a/amforth-6.5/avr8/words/d-plus.asm b/amforth-6.5/avr8/words/d-plus.asm
new file mode 100644
index 0000000..60286dd
--- /dev/null
+++ b/amforth-6.5/avr8/words/d-plus.asm
@@ -0,0 +1,27 @@
+; ( d1 d2 -- d3)
+; Arithmetics
+; add 2 double cell values
+VE_DPLUS:
+ .dw $ff02
+ .db "d+"
+ .dw VE_HEAD
+ .set VE_HEAD = VE_DPLUS
+XT_DPLUS:
+ .dw PFA_DPLUS
+PFA_DPLUS:
+ ld temp2, Y+
+ ld temp3, Y+
+
+ ld temp4, Y+
+ ld temp5, Y+
+ ld temp6, Y+
+ ld temp7, Y+
+
+ add temp2, temp6
+ adc temp3, temp7
+ adc tosl, temp4
+ adc tosh, temp5
+
+ st -Y, temp3
+ st -Y, temp2
+ jmp_ DO_NEXT