Add EOT ASCII const
This commit is contained in:
parent
3d47c28a28
commit
1cbef2f210
14
blk.fs
14
blk.fs
@ -1717,7 +1717,8 @@ with "390 LOAD"
|
|||||||
( ----- 356 )
|
( ----- 356 )
|
||||||
SYSVARS 0x53 + :** EMIT
|
SYSVARS 0x53 + :** EMIT
|
||||||
: STYPE C@+ ( a len ) 0 DO C@+ EMIT LOOP DROP ;
|
: 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 ;
|
: NL> 0x50 RAM+ C@ ?DUP IF EMIT ELSE 13 EMIT 10 EMIT THEN ;
|
||||||
: ERR STYPE ABORT ;
|
: ERR STYPE ABORT ;
|
||||||
: (uflw) LIT" stack underflow" ERR ;
|
: (uflw) LIT" stack underflow" ERR ;
|
||||||
@ -1806,14 +1807,13 @@ SYSVARS 0x0c + :** C<*
|
|||||||
C< DUP 34 ( ASCII " ) = IF DROP EXIT THEN C,
|
C< DUP 34 ( ASCII " ) = IF DROP EXIT THEN C,
|
||||||
AGAIN ;
|
AGAIN ;
|
||||||
( ----- 364 )
|
( ----- 364 )
|
||||||
: WS? 33 < ;
|
: WS? SPC <= ;
|
||||||
: EOT? 4 = ; ( 4 == ASCII EOT, CTRL+D )
|
: EOT? EOT = ;
|
||||||
: EOT, 4 C, ;
|
: EOT, EOT C, ;
|
||||||
|
|
||||||
: TOWORD
|
: TOWORD ( -- c, c being the first letter of the word )
|
||||||
0 ( dummy ) BEGIN
|
0 ( dummy ) BEGIN
|
||||||
DROP C< DUP WS? NOT OVER EOT? OR
|
DROP C< DUP WS? NOT OVER EOT? OR UNTIL ;
|
||||||
UNTIL ;
|
|
||||||
( ----- 365 )
|
( ----- 365 )
|
||||||
( Read word from C<, copy to WORDBUF, null-terminate, and
|
( Read word from C<, copy to WORDBUF, null-terminate, and
|
||||||
return WORDBUF. )
|
return WORDBUF. )
|
||||||
|
BIN
cvm/stage.bin
BIN
cvm/stage.bin
Binary file not shown.
@ -265,7 +265,7 @@ WORD -- a Read one word from buffered input and push its
|
|||||||
idered a word).
|
idered a word).
|
||||||
|
|
||||||
These ASCII consts are defined:
|
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-
|
KEY? and EMIT are ialiases to (key?) and (emit) (see TTY proto-
|
||||||
col in protocol.txt). KEY is a loop over KEY?.
|
col in protocol.txt). KEY is a loop over KEY?.
|
||||||
|
Loading…
Reference in New Issue
Block a user