mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-20 15:18:05 +11:00
3d908cef3a
This allows us to get rid of the (parse*) indirection.
17 lines
488 B
Plaintext
17 lines
488 B
Plaintext
( Read word from C<, copy to WORDBUF, null-terminate, and
|
|
return, make HL point to WORDBUF. )
|
|
: WORD
|
|
0x0e RAM+ ( 0e == WORDBUF )
|
|
TOWORD ( a c )
|
|
BEGIN
|
|
( We take advantage of the fact that char MSB is
|
|
always zero to pre-write our null-termination )
|
|
OVER ! 1+ ( a+1 )
|
|
C< ( a c )
|
|
DUP WS?
|
|
UNTIL
|
|
( a this point, PS is: a WS )
|
|
( null-termination is already written )
|
|
2DROP
|
|
0x0e RAM+ ;
|