aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/words/squote.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/common/words/squote.asm')
-rw-r--r--amforth-6.5/common/words/squote.asm33
1 files changed, 33 insertions, 0 deletions
diff --git a/amforth-6.5/common/words/squote.asm b/amforth-6.5/common/words/squote.asm
new file mode 100644
index 0000000..98cfa33
--- /dev/null
+++ b/amforth-6.5/common/words/squote.asm
@@ -0,0 +1,33 @@
+; ( -- addr len) (C: <cchar> -- )
+; Compiler
+; compiles a string to flash, at runtime leaves ( -- flash-addr count) on stack
+
+.if cpu_msp430==1
+ DW link
+ DB 0FEh ; immediate
+.set link = $
+ DB 2,"s",'"'
+ .align 16
+XT_SQUOTE: DW DOCOLON
+.endif
+
+.if cpu_avr8==1
+VE_SQUOTE:
+ .dw $0002
+ .db "s",$22
+ .dw VE_HEAD
+ .set VE_HEAD = VE_SQUOTE
+XT_SQUOTE:
+ .dw DO_COLON
+PFA_SQUOTE:
+.endif
+ .dw XT_DOLITERAL
+ .dw 34 ; 0x22
+ .dw XT_PARSE ; ( -- addr n)
+ .dw XT_STATE
+ .dw XT_FETCH
+ .dw XT_DOCONDBRANCH
+ DEST(PFA_SQUOTE1)
+ .dw XT_SLITERAL
+PFA_SQUOTE1:
+ .dw XT_EXIT