1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:38:05 +11:00

Add word ,"

This commit is contained in:
Virgil Dupras 2020-04-26 08:47:29 -04:00
parent 4b7247a971
commit 0e3cf7fa02
4 changed files with 16 additions and 14 deletions

View File

@ -1,3 +1,4 @@
," xxx" -- Write xxx to HERE
." xxx" -- *I* Compiles string literal xxx followed by a
call to (print).
C<? -- f Returns whether there's a char waiting in buf.
@ -11,6 +12,5 @@ IN> -- a Address of variable containing current pos in
KEY -- c Get char c from direct input
PC! c a -- Spit c to port a
PC@ a -- c Fetch c from port a
WORD -- a Read one word from buffered input and push its
addr.
(cont.)

View File

@ -1,4 +1,5 @@
(cont.)
WORD -- a Read one word from buffered input and push its
addr.
There are also ascii const emitters:
BS
CR
@ -13,4 +14,3 @@ SPC

11
blk/443
View File

@ -1,11 +1,12 @@
: ."
34 , ( 34 == litWord )
: ,"
BEGIN
C<
( 34 is ASCII for " )
DUP 34 = IF DROP 0 THEN
DUP C,
NOT UNTIL
DUP 34 = IF DROP EXIT THEN C,
AGAIN ;
: ."
34 , ( 34 == litWord ) ," 0 C,
COMPILE (print)
; IMMEDIATE

View File

@ -12,14 +12,15 @@
AGAIN
;
: ."
34 , ( 34 == litWord )
: ,"
BEGIN
C<
( 34 is ASCII for " )
DUP 34 = IF DROP 0 THEN
DUP C,
NOT UNTIL
DUP 34 = IF DROP EXIT THEN C,
AGAIN ;
: ."
34 , ( 34 == litWord ) ," 0 C,
COMPILE (print)
; IMMEDIATE