+
+ WORD p_literal,'LIT',fasm
+ ;; ( -- v )
+ ;; Push the value of successor cell onto stack, and skip it
+ push qword [rsi]
+ add rsi,8
+ next
+
+ WORD p_literal_string,'S"',fasm
+ ;; " (fool emacs)
+ ;; ( -- chars* n )
+ ;; Push the value of successor cell onto stack, and skip it
+ mov rax,qword [rsi]
+ add rsi,8
+ push rsi
+ push rax
+ add rsi,rax
+ next
+
+;;; ========================================
+;;; The text interpreter
+
+ WORD p_state,'STATE',dovariable
+ ;; Interpretation state (0=interpreting, 1=compiling)
+ dq 0
+
+ WORD p_left_bracket,'[',fasm,IMMEDIATE
+ ;; ( -- )
+ ;; Change state to interpretation state.
+ mov qword[p_state_DFA],0
+ next
+
+ WORD p_right_bracket,']',fasm
+ ;; ( -- )
+ ;; Change state to compilation state.
+ mov qword[p_state_DFA],1
+ next
+
+ WORD p_number,'NUMBER'
+ ;; ( chars* n -- [ 0 ]/[ v 1 ] )
+
+ WORD p_this_word,'THIS-WORD',dovariable
+ dq 0,0 ; ( n chars* )
+
+ WORD p_evaluate_stream,'EVALUATE-STREAM'
+ ;; ( stream -- *?* flag )
+ ;; Execute the words from the given stream
+ ;; returns 1 if stream ends and 0 if an unknown word is found
+
+p_evaluate_stream_LOOP:
+ dq p_read_word ; ( -- chars* n )
+ dq p_zero_branch
+ dq p_evaluate_stream_END - $ - 8