abort loading files on error
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Tue, 8 Jun 2021 06:23:39 +0000 (16:23 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Tue, 8 Jun 2021 06:23:39 +0000 (16:23 +1000)
rrqforth.asm

index 5187c902a06c7a202b08a4292bb98482d2a897e6..18009d41bfba8f75f5b7afef2463f89988bf10e6 100644 (file)
@@ -272,7 +272,10 @@ p_process_args_loop:
        je p_process_args_loop
        push rax
        push rax
-       DOFORTH p_strlen, p_load_file, p_drop
+       FORTH
+       dq p_strlen, p_load_file
+       BRANCH 0, p_quit_ERROR
+       ENDFORTH
        jmp p_process_args_loop
 p_process_args_done:
        popr rsi
@@ -296,26 +299,19 @@ last_forth_word:
 p_quit_INITIALIZED:
        ;; Setup INPUT from STDIN
        FORTH
-       dq p_verboseQ
-       dq p_get
+       dq p_verboseQ, p_get
        BRANCH 0,p_quit_EVAL
-       dq p_program_version
-       dq p_tell
+       dq p_program_version, p_tell
 p_quit_EVAL:
        dq p_stdin, p_evaluate_stream
        BRANCH 0,p_quit_ERROR
-       dq p_false
-       dq sys_exit
+       dq p_false, sys_exit
 p_quit_ERROR:
        dq p_literal_string
        STRING 10,'*** Unknown word: '
        dq p_tell
-       dq p_this_word
-       dq p_2get
-       dq p_tell
-       dq p_literal_string
-       STRING 10
-       dq p_tell
+       dq p_this_word, p_2get, p_tell
+       dq p_nl, p_emit
        ENDFORTH
        mov rbp,RS_TOP          ; reset the return stack
        jmp p_quit_INITIALIZED