1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-15 04:58:05 +11:00
collapseos/blk/366

14 lines
356 B
Plaintext
Raw Normal View History

( Read word from C<, copy to WORDBUF, null-terminate, and
return WORDBUF. )
2020-05-25 10:50:26 +10:00
: _wb 0x0e RAM+ ;
2020-05-26 10:16:07 +10:00
: _eot 0x0401 _wb ! _wb ;
: WORD
2020-05-25 10:50:26 +10:00
_wb 1+ TOWORD ( a c )
DUP EOT? IF 2DROP _eot EXIT THEN
BEGIN
2020-05-26 10:16:07 +10:00
OVER C! 1+ C< ( a c )
OVER 0x2e RAM+ = OVER WS? OR
UNTIL ( a c )
2020-05-25 10:50:26 +10:00
SWAP _wb - 1- ( ws len ) _wb C!
2020-05-26 10:16:07 +10:00
EOT? IF _eot ELSE _wb THEN ;