From: Ralph Ronnquist Date: Wed, 26 May 2021 03:54:17 +0000 (+1000) Subject: added the left-parenthesis word (comments) X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=85117fe5745fabdf5e221bb7eaa65bee7ba9f751;p=rrq%2Frrqforth.git added the left-parenthesis word (comments) --- diff --git a/rrqforth.asm b/rrqforth.asm index ecea117..7c1b5ca 100644 --- a/rrqforth.asm +++ b/rrqforth.asm @@ -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.