瀏覽代碼

forth: Forth-ify "TOWORD"

pull/95/head
Virgil Dupras 4 年之前
父節點
當前提交
c1693c6256
共有 3 個檔案被更改,包括 9 行新增18 行删除
  1. 二進制
      emul/forth/z80c.bin
  2. +2
    -17
      forth/forth.asm
  3. +7
    -1
      forth/icore.fs

二進制
emul/forth/z80c.bin 查看文件


+ 2
- 17
forth/forth.asm 查看文件

@@ -875,26 +875,11 @@ NOT:
push hl
jp next

; ( -- c )
; C< DUP 32 CMP 1 - SKIP? EXIT DROP TOWORD
.db "TOWORD"
.dw $-NOT
.db 6
TOWORD:
.dw compiledWord
.dw CIN
.dw DUP
.dw ISWS
.dw CSKIP
.dw EXIT
.dw DROP
.dw TOWORD
.dw EXIT

.fill 73
.fill 100

.db "(parsed)"
.dw $-TOWORD
.dw $-NOT
.db 8
PARSED:
.dw nativeWord


+ 7
- 1
forth/icore.fs 查看文件

@@ -78,12 +78,18 @@
HERE @ 1 + HERE !
;

: TOWORD
BEGIN
C< DUP WS? NOT IF EXIT THEN DROP
AGAIN
;

( Read word from C<, copy to WORDBUF, null-terminate, and
return, make HL point to WORDBUF. )
: WORD
( JTBL+30 == WORDBUF )
[ JTBL 30 + @ LITN ] ( a )
TOWORD ( a c )
_c TOWORD ( a c )
BEGIN
( We take advantage of the fact that char MSB is
always zero to pre-write our null-termination )


Loading…
取消
儲存