- WORD p_literal_string,'S"',fasm
- ;; " (fool emacs)
- ;; ( -- chars* n )
- ;; Push the value of successor cell onto stack, and skip it
+ WORD p_literal_string,'S"',fasm ;; " (fool emacs)
+ ;; Compilation: ( "..." -- )
+ ;; Interpretation: ( -- char* n )
+ ;; Save string on heap to make available at interpretation
+ cmp qword [p_state_DFA],0
+ je p_literal_string_interpret
+ ;; compilation mode: read stream until \" onto the heap
+ pushr rsi
+ mov rdi,[p_here_DFA]
+ lea rbx,[p_literal_string_CFA]
+ mov qword [rdi],rbx
+ add rdi,8
+ pop rbx
+ mov qword [rdi],rbx
+ add rdi,8
+ cmp rbx,0
+ je p_literal_string_end
+ lea rsi,[p_pad_DFA]
+p_literal_string_copy:
+ lodsb
+ stosb
+ dec rbx
+ jg p_literal_string_copy
+p_literal_string_end:
+ mov qword [p_here_DFA],rdi
+ popr rsi
+ next
+
+p_literal_string_interpret: