Browse Source

Add word NL

pull/102/head
Virgil Dupras 4 years ago
parent
commit
24e9fa0c30
13 changed files with 20 additions and 19 deletions
  1. +4
    -5
      blk/062
  2. +1
    -1
      blk/081
  3. +3
    -3
      blk/084
  4. +1
    -1
      blk/103
  5. +3
    -3
      blk/130
  6. +1
    -1
      blk/269
  7. +1
    -0
      blk/411
  8. +2
    -1
      blk/440
  9. +1
    -1
      blk/444
  10. +1
    -1
      blk/456
  11. +1
    -1
      blk/459
  12. BIN
      emul/forth.bin
  13. +1
    -1
      emul/stage1.fs

+ 4
- 5
blk/062 View File

@@ -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.





+ 1
- 1
blk/081 View File

@@ -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


+ 3
- 3
blk/084 View File

@@ -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.





+ 1
- 1
blk/103 View File

@@ -1,5 +1,5 @@
VARIABLE ACC
: _LIST ." Block " DUP . CRLF LIST ;
: _LIST ." Block " DUP . NL LIST ;
: _NUM
ACC @ SWAP _pdacc
IF _LIST 0 THEN


+ 3
- 3
blk/130 View File

@@ -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 ;

+ 1
- 1
blk/269 View File

@@ -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
- 0
blk/411 View File

@@ -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<?* )


+ 2
- 1
blk/440 View File

@@ -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 ;


+ 1
- 1
blk/444 View File

@@ -12,5 +12,5 @@
IF DROP '.' THEN
EMIT
LOOP
CRLF
NL
;

+ 1
- 1
blk/456 View File

@@ -5,7 +5,7 @@
16 0 DO
I 1+ .2 SPC
64 I * BLK( + (print)
CRLF
NL
LOOP
;


+ 1
- 1
blk/459 View File

@@ -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 View File


+ 1
- 1
emul/stage1.fs View File

@@ -19,7 +19,7 @@
['] EFS! BLK!* !
RDLN$
LIT< _sys [entry]
." Collapse OS" CRLF
." Collapse OS" NL
INTERPRET
;



Loading…
Cancel
Save