aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/words/q-stack.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/common/words/q-stack.asm')
-rw-r--r--amforth-6.5/common/words/q-stack.asm26
1 files changed, 26 insertions, 0 deletions
diff --git a/amforth-6.5/common/words/q-stack.asm b/amforth-6.5/common/words/q-stack.asm
new file mode 100644
index 0000000..f652bb2
--- /dev/null
+++ b/amforth-6.5/common/words/q-stack.asm
@@ -0,0 +1,26 @@
+; ( -- )
+; Tools
+; check data stack depth and exit to quit if underrun
+.if cpu_msp430==1
+ HEADER(XT_QSTACK,6,"?stack",DOCOLON)
+.endif
+
+.if cpu_avr8==1
+VE_QSTACK:
+ .dw $ff06
+ .db "?stack"
+ .dw VE_HEAD
+ .set VE_HEAD = VE_QSTACK
+XT_QSTACK:
+ .dw DO_COLON
+PFA_QSTACK:
+.endif
+ .dw XT_DEPTH
+ .dw XT_ZEROLESS
+ .dw XT_DOCONDBRANCH
+ DEST(PFA_QSTACK1)
+ .dw XT_DOLITERAL
+ .dw -4
+ .dw XT_THROW
+PFA_QSTACK1:
+ .dw XT_EXIT