collapseos/blk/366
Virgil Dupras f6ded7712e VE: add 't'
This is the first commit I do entirely in VE. It's a habit I'm planning
on taking as it helps a lot to find usability issues.
2020-06-11 18:12:01 -04:00

17 lines
359 B
Plaintext

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