Browse Source

forth: Forth-ify "(parse)"

pull/95/head
Virgil Dupras 4 years ago
parent
commit
edcd80e3a6
3 changed files with 8 additions and 18 deletions
  1. BIN
      emul/forth/z80c.bin
  2. +2
    -18
      forth/forth.asm
  3. +6
    -0
      forth/icore.fs

BIN
emul/forth/z80c.bin View File


+ 2
- 18
forth/forth.asm View File

@@ -1123,23 +1123,7 @@ PARSED:
jp next


.db "(parse)"
.dw $-PARSED
.db 7
PARSE:
.dw compiledWord
.dw PARSED
.dw CSKIP
.dw .error
; success, stack is already good, we can exit
.dw EXIT

.error:
.dw compiledWord
.dw LIT
.db "unknown word", 0
.dw PRINT
.dw ABORT
.fill 41


; Indirect parse caller. Reads PARSEPTR and calls
@@ -1154,7 +1138,7 @@ PARSEI:
; Spit name (in (HL)) + prev in (HERE) and adjust (HERE) and (CURRENT)
; HL points to new (HERE)
.db "(entry)"
.dw $-PARSE
.dw $-PARSED
.db 7
ENTRYHEAD:
.dw compiledWord


+ 6
- 0
forth/icore.fs View File

@@ -55,6 +55,12 @@
AGAIN
;

( This is only the "early parser" in earlier stages. No need
for an abort message )
: (parse)
(parsed) SKIP? ABORT
;

( ; has to be defined last because it can't be executed now )
: X ( can't have its real name now )
['] EXIT ,


Loading…
Cancel
Save