(We will probably want to write this in assembly when we add more
functionality.)
+;; The INTERPRET word reads and interprets user input. It's behavior depends on
+;; the current STATE. It provides special handling for integers. (TODO)
+forth INTERPRET, 'INTERPRET'
+ dq READ_WORD
+ dq FIND
+ dq TCFA
+ dq EXEC
+ dq EXIT
+
;; .U prints the value on the stack as an unsigned integer in hexadecimal.
forth_asm DOTU, '.U'
mov [.length], 0
;; .U prints the value on the stack as an unsigned integer in hexadecimal.
forth_asm DOTU, '.U'
mov [.length], 0
forth MAIN, 'MAIN'
dq HELLO
forth MAIN, 'MAIN'
dq HELLO
- dq READ_WORD, FIND, TCFA, EXEC
- dq BRANCH, -8 * 5
+ dq INTERPRET
+ dq BRANCH, -8 * 2
dq TERMINATE
segment readable writable
dq TERMINATE
segment readable writable