mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 17:18:06 +11:00
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+ ;
|