add IMMEDIAET and handle it
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 26 May 2021 03:55:15 +0000 (13:55 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 26 May 2021 03:55:15 +0000 (13:55 +1000)
compile.asm

index 8102cbc813452b24d7ad20f11b64b06c249bbac3..8a86f06c58a8356cabc1ab15bd036b669174f0fc 100644 (file)
@@ -225,7 +225,7 @@ p_numper_POSITIVE:
        ;; ( stream* -- *?* flag )
        ;; Execute the words from the given stream
        ;; returns 1 if stream ends and 0 if an unknown word is found
-       dq p_ltR                ; Keep the stream on the return stack.
+       dq p_gtR                ; Keep the stream on the return stack.
 p_evaluate_stream_PROMPT:
        dq p_depth
        dq p_dot
@@ -263,6 +263,11 @@ p_evaluate_stream_NOTWORD:
        dq p_drop
        dq p_number
        BRANCH 0,p_evaluate_stream_BAD ; branch if 0
+       dq p_state
+       dq p_get
+       BRANCH 0,p_evaluate_stream_AFTER ; branch if 0
+       dq p_literal, p_literal
+       dq p_comma, p_comma
 p_evaluate_stream_AFTER:
        dq p_Rget
        dq p_stream_nchars
@@ -295,3 +300,11 @@ p_evaluate_stream_BAD:
        dq p_left_bracket
        dq p_literal, p_exit
        dq p_comma
+
+       WORD p_immediate,'IMMEDIATE',fasm,IMMEDIATE
+       ;; ( -- )
+       ;; Set "immediate flag" of the word being defined
+       mov rax,qword [p_wordlist_DFA]
+       mov rax,qword [rax]     ; tfa of most recent word
+       mov qword [rax+16],1    ; set the flags field to 1
+       next