diff --git a/blk.fs b/blk.fs index e854f9d..5c02fb4 100644 --- a/blk.fs +++ b/blk.fs @@ -1717,7 +1717,8 @@ with "390 LOAD" ( ----- 356 ) SYSVARS 0x53 + :** EMIT : STYPE C@+ ( a len ) 0 DO C@+ EMIT LOOP DROP ; -: BS 0x8 ; : LF 0xa ; : CR 0xd ; : SPC 0x20 ; : SPC> SPC EMIT ; +: EOT 0x4 ; : BS 0x8 ; : LF 0xa ; : CR 0xd ; : SPC 0x20 ; +: SPC> SPC EMIT ; : NL> 0x50 RAM+ C@ ?DUP IF EMIT ELSE 13 EMIT 10 EMIT THEN ; : ERR STYPE ABORT ; : (uflw) LIT" stack underflow" ERR ; @@ -1806,14 +1807,13 @@ SYSVARS 0x0c + :** C<* C< DUP 34 ( ASCII " ) = IF DROP EXIT THEN C, AGAIN ; ( ----- 364 ) -: WS? 33 < ; -: EOT? 4 = ; ( 4 == ASCII EOT, CTRL+D ) -: EOT, 4 C, ; +: WS? SPC <= ; +: EOT? EOT = ; +: EOT, EOT C, ; -: TOWORD +: TOWORD ( -- c, c being the first letter of the word ) 0 ( dummy ) BEGIN - DROP C< DUP WS? NOT OVER EOT? OR - UNTIL ; + DROP C< DUP WS? NOT OVER EOT? OR UNTIL ; ( ----- 365 ) ( Read word from C<, copy to WORDBUF, null-terminate, and return WORDBUF. ) diff --git a/cvm/stage.bin b/cvm/stage.bin index 3107e29..5def5c9 100644 Binary files a/cvm/stage.bin and b/cvm/stage.bin differ diff --git a/doc/dict.txt b/doc/dict.txt index cf06af8..84658d9 100644 --- a/doc/dict.txt +++ b/doc/dict.txt @@ -265,7 +265,7 @@ WORD -- a Read one word from buffered input and push its idered a word). These ASCII consts are defined: -BS CR LF SPC +EOT BS CR LF SPC KEY? and EMIT are ialiases to (key?) and (emit) (see TTY proto- col in protocol.txt). KEY is a loop over KEY?.