2020-05-03 11:21:47 +10:00
|
|
|
( Read word from C<, copy to WORDBUF, null-terminate, and
|
2020-05-14 10:39:53 +10:00
|
|
|
return WORDBUF. )
|
2020-05-03 11:21:47 +10:00
|
|
|
: WORD
|
2020-05-14 11:44:46 +10:00
|
|
|
0x0e RAM+ TOWORD ( a c )
|
|
|
|
DUP EOT? IF OVER ! EXIT THEN
|
2020-05-03 11:21:47 +10:00
|
|
|
BEGIN
|
|
|
|
( We take advantage of the fact that char MSB is
|
|
|
|
always zero to pre-write our null-termination )
|
2020-05-14 11:44:46 +10:00
|
|
|
OVER ! 1+ C< ( a c )
|
2020-05-14 10:39:53 +10:00
|
|
|
OVER 0x2d ( 2e-1 for NULL ) RAM+ = OVER WS? OR
|
2020-05-14 11:44:46 +10:00
|
|
|
UNTIL ( a c )
|
|
|
|
SWAP DROP 0x0e RAM+ ( ws a )
|
|
|
|
SWAP EOT? IF 4 OVER ! THEN ;
|