1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 19:48:06 +11:00

Make KEY and EMIT into switch words

This commit is contained in:
Virgil Dupras 2020-10-28 16:00:58 -04:00
parent d3ec0e3a6c
commit 5e13dcedf3
6 changed files with 12 additions and 17 deletions

View File

@ -1,6 +1,4 @@
: EMIT SYSVARS 0x53 + :** EMIT
( 0x53==(emit) override )
0x53 RAM+ @ ?DUP IF EXECUTE ELSE (emit) THEN ;
: (print) C@+ ( a len ) 0 DO C@+ EMIT LOOP DROP ; : (print) C@+ ( a len ) 0 DO C@+ EMIT LOOP DROP ;
: BS 8 EMIT ; : LF 10 EMIT ; : CR 13 EMIT ; : BS 8 EMIT ; : LF 10 EMIT ; : CR 13 EMIT ;
: CRLF CR LF ; : SPC 32 EMIT ; : CRLF CR LF ; : SPC 32 EMIT ;

View File

@ -8,9 +8,6 @@
; ;
( del is same as backspace ) ( del is same as backspace )
: BS? DUP 0x7f = SWAP 0x8 = OR ; : BS? DUP 0x7f = SWAP 0x8 = OR ;
SYSVARS 0x55 + :** KEY
: KEY
0x55 RAM+ @ ( (key) override )
?DUP IF EXECUTE ELSE (key) THEN ;
( cont.: read one char into input buffer and returns whether we ( cont.: read one char into input buffer and returns whether we
should continue, that is, whether CR was not met. ) should continue, that is, whether CR was not met. )

View File

@ -3,8 +3,8 @@
0x02 RAM+ CURRENT* ! 0x02 RAM+ CURRENT* !
CURRENT @ 0x2e RAM+ ! ( 2e == BOOT C< PTR ) CURRENT @ 0x2e RAM+ ! ( 2e == BOOT C< PTR )
0 0x08 RAM+ ! ( 08 == C<* override ) 0 0x08 RAM+ ! ( 08 == C<* override )
0 0x53 RAM+ ! ( 53 == (emit) override ) ['] (emit) ['] EMIT **!
0 0x55 RAM+ ! ( 55 == (key) override ) ['] (key) ['] KEY **!
['] CRLF ['] NL **! ['] CRLF ['] NL **!
( 0c == C<* ) ( 0c == C<* )
['] (boot<) 0x0c RAM+ ! ['] (boot<) 0x0c RAM+ !

Binary file not shown.

View File

@ -233,14 +233,14 @@ blocks per disk.
You'll need to send those blocks through RS-232. Begin by taking over the You'll need to send those blocks through RS-232. Begin by taking over the
prompt: prompt:
' *CL> 0x53 RAM+ ! ' *CL> ' EMIT **!
' *CL< 0x55 RAM+ ! ' *CL< ' KEY **!
See B80 for details about those RAM offsets. Your serial link now has the See B80 for details about those RAM offsets. Your serial link now has the
prompt. You will also have to make your newlines CRLF. The TRS-80 wants CR prompt. You will also have to make your newlines CRLF. The TRS-80 wants CR
only, but serial communications (and `blkup`) expect CRLF: only, but serial communications (and `blkup`) expect CRLF:
' CRLF 0x0a RAM+ ! ' CRLF ' NL **!
Now, you can use `/tools/blkup` to send a disk's contents. First, Now, you can use `/tools/blkup` to send a disk's contents. First,
extract the first 100 blocks from blkfs: extract the first 100 blocks from blkfs:
@ -264,9 +264,9 @@ own Collapse OS floppy set. See Usage guide (B3) for details.
Once you're done, you will want to go back to local control: Once you're done, you will want to go back to local control:
' CR 0x0a RAM+ ! ' CR ' NL **!
0 0x55 RAM+ ! ' (emit) ' EMIT **!
0 0x53 RAM+ ! ' (key) ' KEY **!
## Self-hosting ## Self-hosting

View File

@ -14,7 +14,7 @@ RS_ADDR 0x80 - CONSTANT SYSVARS
(entry) _ (entry) _
( Update LATEST ) ( Update LATEST )
PC ORG @ 8 + ! PC ORG @ 8 + !
( 0x0a == NLPTR. TRS-80 wants CR-only newlines ) ( TRS-80 wants CR-only newlines )
," ' CR 0x0a RAM+ ! BLK$ FD$ " EOT, ," ' CR ' NL **! BLK$ FD$ " EOT,
ORG @ 256 /MOD 2 PC! 2 PC! ORG @ 256 /MOD 2 PC! 2 PC!
H@ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!