include 'compile.asm'
WORD p_program_version,'PROGRAM_VERSION',dostring
- STRING 'RRQ Forth version 0.1 - 2021-05-13',10
+ STRING 'RRQ Forth version 0.1 - 2021-05-22',10
WORD p_stdin,'STDIN',dovalue
;; Initialised to hold a STREAM for fd 0
dq 0
+ WORD p_args,'ARGS',dostring
+ ;; Pointer to initial argument block
+ dq 0 ; *(int argc,(char*[argc]) argv)
+
;;; The main entry point.
+main:
+ ;; Initial rsp points to the arguments block of size (64 bits)
+ ;; followed by the argument pointers.
+ mov qword [p_args_DFA],rsp
+ jmp p_quit_DFA ; QUIT
+
;;; This word is also the last word before syscalls
last_forth_word:
WORD p_quit,'QUIT',fasm
;; QUIT is the program entry point ********************
-main:
+
mov rsp,DS_TOP
mov rbp,RS_TOP
cmp qword [p_stdin_DFA],0