added the left-parenthesis word (comments)
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 26 May 2021 03:54:17 +0000 (13:54 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 26 May 2021 03:54:17 +0000 (13:54 +1000)
rrqforth.asm

index ecea1171612a82f840f91d82ce44931432805576..7c1b5ca1ed314decfdfb7dbec0176ca2eecb40fb 100644 (file)
@@ -193,7 +193,28 @@ include 'compile.asm'
        ;; Pointer to initial argument block
        dq 0       ; *(int argc,(char*[argc]) argv)
 
-;;; The main entry point.
+       WORD p_lparen,'(',fasm,IMMEDIATE
+       pushr rsi
+p_lparen_loop:
+       DOFORTH  p_stdin, p_read_word
+       pop rax
+       pop rbx
+       cmp rax,0 ; end of stream
+       je p_lparen_exit
+       cmp rax,1
+       jne p_lparen_loop
+       push rbx
+       push qword ')'
+       push 1
+       DOFORTH p_strncmp
+       pop rax
+       cmp rax,0
+       jne p_lparen_loop
+p_lparen_exit:
+       popr rsi
+       next
+       
+;;; ******** The main entry point. ********
 main:  
        ;; Initial rsp points to the arguments block of size (64 bits)
        ;; followed by the argument pointers.