mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 04:58:05 +11:00
forth: Forth-ify "TOWORD"
This commit is contained in:
parent
8b7947bc6a
commit
c1693c6256
Binary file not shown.
@ -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
|
||||
|
@ -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…
Reference in New Issue
Block a user