mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-24 14:18:06 +11:00
Add word NL
This commit is contained in:
parent
a3c3a2f44a
commit
24e9fa0c30
9
blk/062
9
blk/062
@ -1,11 +1,10 @@
|
||||
WORD -- a Read one word from buffered input and push its
|
||||
addr.
|
||||
There are also ascii const emitters:
|
||||
BS
|
||||
CR
|
||||
LF
|
||||
SPC
|
||||
|
||||
BS CR LF SPC CRLF
|
||||
NL is an indirect word (see B80) that aliases to CRLF by
|
||||
default and that should generally be used when we want to emit
|
||||
a newline.
|
||||
|
||||
|
||||
|
||||
|
2
blk/081
2
blk/081
@ -4,7 +4,7 @@ RAMSTART INITIAL_SP +55 (key) override
|
||||
+04 HERE +59 blk's variables
|
||||
+06 C<? +5b z80a's variables
|
||||
+08 C<* override +5d adev's variables
|
||||
+0a RESERVED +5f FUTURE USES
|
||||
+0a NLPTR +5f FUTURE USES
|
||||
+0c C<* +70 DRIVERS
|
||||
+0e WORDBUF +80 RAMEND
|
||||
+2e BOOT C< PTR
|
||||
|
6
blk/084
6
blk/084
@ -4,6 +4,9 @@ address. Most of the time, it points to RAM+2, but sometimes,
|
||||
when maintaining alternative dicts (during cross compilation
|
||||
for example), it can point elsewhere.
|
||||
|
||||
NLPTR points to an alternative routine for NL (by default,
|
||||
CRLF).
|
||||
|
||||
FUTURE USES section is unused for now.
|
||||
|
||||
DRIVERS section is reserved for recipe-specific
|
||||
@ -11,6 +14,3 @@ drivers. Here is a list of known usages:
|
||||
|
||||
* 0x70-0x78: ACIA buffer pointers in RC2014 recipes.
|
||||
|
||||
|
||||
|
||||
|
||||
|
2
blk/103
2
blk/103
@ -1,5 +1,5 @@
|
||||
VARIABLE ACC
|
||||
: _LIST ." Block " DUP . CRLF LIST ;
|
||||
: _LIST ." Block " DUP . NL LIST ;
|
||||
: _NUM
|
||||
ACC @ SWAP _pdacc
|
||||
IF _LIST 0 THEN
|
||||
|
6
blk/130
6
blk/130
@ -4,8 +4,8 @@
|
||||
DUP ROT SWAP H@ 4 + ( u src u dst )
|
||||
SWAP MOVE ( u )
|
||||
4 + DUP CURRENT @ WORD( + ( u we )
|
||||
DUP .X CRLF
|
||||
SWAP CURRENT @ PREV + DUP .X CRLF ( we wr )
|
||||
DUP .X NL
|
||||
SWAP CURRENT @ PREV + DUP .X NL ( we wr )
|
||||
BEGIN ( we wr )
|
||||
DUP ROT ( wr wr we )
|
||||
H@ @ H@ 2+ @ ( wr wr we ol o )
|
||||
@ -13,4 +13,4 @@
|
||||
DUP PREV SWAP ( wr oldwr )
|
||||
WORD( SWAP ( we wr )
|
||||
DUP 4 - H@ <= ( are we finished? )
|
||||
UNTIL H@ 4 + .X CRLF ;
|
||||
UNTIL H@ 4 + .X NL ;
|
||||
|
2
blk/269
2
blk/269
@ -1,3 +1,3 @@
|
||||
( b1 b2 -- )
|
||||
: XPACKR 1+ SWAP DO I DUP . CRLF XPACK LOOP ;
|
||||
: XPACKR 1+ SWAP DO I DUP . NL XPACK LOOP ;
|
||||
|
||||
|
1
blk/411
1
blk/411
@ -4,6 +4,7 @@
|
||||
0 0x08 RAM+ ! ( 08 == C<* override )
|
||||
0 0x53 RAM+ ! ( 53 == (emit) override )
|
||||
0 0x55 RAM+ ! ( 55 == (key) override )
|
||||
0 0x0a RAM+ ! ( NLPTR )
|
||||
( 0c == C<* )
|
||||
LIT< (boot<) (find) DROP 0x0c RAM+ !
|
||||
( boot< always has a char waiting. 06 == C<?* )
|
||||
|
3
blk/440
3
blk/440
@ -3,7 +3,8 @@
|
||||
: CR 13 EMIT ;
|
||||
: CRLF CR LF ;
|
||||
: SPC 32 EMIT ;
|
||||
: NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ;
|
||||
|
||||
: (wnf) (print) SPC ABORT" word not found" ;
|
||||
: (ok) SPC ." ok" CRLF ;
|
||||
: (ok) SPC ." ok" NL ;
|
||||
|
||||
|
2
blk/459
2
blk/459
@ -1,2 +1,2 @@
|
||||
( b1 b2 -- )
|
||||
: LOADR 1+ SWAP DO I DUP . CRLF LOAD LOOP ;
|
||||
: LOADR 1+ SWAP DO I DUP . NL LOAD LOOP ;
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
@ -19,7 +19,7 @@
|
||||
['] EFS! BLK!* !
|
||||
RDLN$
|
||||
LIT< _sys [entry]
|
||||
." Collapse OS" CRLF
|
||||
." Collapse OS" NL
|
||||
INTERPRET
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user