X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=bootstrap.asm;h=dd72ed9e85e8f53ec96830962457f2f4cd6d8d04;hb=fbd07fa0c1aaad0cca46f9b1fc4839e053454f03;hp=1fc941a86e7eac80bb2615bccd64b33c16e0d960;hpb=a856c7d5b35de1b48bdd948186ec4a03f7c3685c;p=rrq%2Fjonasforth.git diff --git a/bootstrap.asm b/bootstrap.asm index 1fc941a..dd72ed9 100644 --- a/bootstrap.asm +++ b/bootstrap.asm @@ -47,11 +47,10 @@ forth OUTOF_IMMEDIATE, ']' dq LIT, 1, STATE, PUT_BYTE dq EXIT -;; The INTERPRET word reads and interprets user input. It's behavior depends on -;; the current STATE. It provides special handling for integers. -forth INTERPRET, 'INTERPRET' - ;; Read word - dq READ_WORD +;; INTERPRET-WORD expects a word as a (buffer, length) pair on the stack. It +;; interprets and executes the word. It's behavior depends on the current STATE. +;; It provides special handling for integers. +forth INTERPRET_WORD, 'INTERPRET-WORD' dq PAIRDUP ;; Stack is (word length word length). dq FIND ; Try to find word @@ -95,3 +94,9 @@ forth INTERPRET, 'INTERPRET' ;; (Number, immediate mode) dq EXIT + +;; The INTERPRET word reads and interprets a single word from the user. +forth INTERPRET, 'INTERPRET' + dq READ_WORD + dq INTERPRET_WORD + dq EXIT