|
@@ -7,14 +7,12 @@ |
|
|
: BLK!* 2 BLKMEM+ ; |
|
|
: BLK!* 2 BLKMEM+ ; |
|
|
( Current blk pointer in ( ) |
|
|
( Current blk pointer in ( ) |
|
|
: BLK> 4 BLKMEM+ ; |
|
|
: BLK> 4 BLKMEM+ ; |
|
|
( backup for CINPTR when LOADing ) |
|
|
|
|
|
: BLKC<* 6 BLKMEM+ ; |
|
|
|
|
|
: BLK( 8 BLKMEM+ ; |
|
|
|
|
|
|
|
|
: BLK( 6 BLKMEM+ ; |
|
|
|
|
|
|
|
|
: BLK$ |
|
|
: BLK$ |
|
|
H@ 0x57 RAM+ ! |
|
|
H@ 0x57 RAM+ ! |
|
|
( 1024 for the block, 8 for variables ) |
|
|
|
|
|
1032 ALLOT |
|
|
|
|
|
|
|
|
( 1024 for the block, 6 for variables ) |
|
|
|
|
|
1030 ALLOT |
|
|
( LOAD detects end of block with ASCII EOT. This is why |
|
|
( LOAD detects end of block with ASCII EOT. This is why |
|
|
we write it there. EOT == 0x04 ) |
|
|
we write it there. EOT == 0x04 ) |
|
|
4 C, |
|
|
4 C, |
|
@@ -42,17 +40,33 @@ |
|
|
DUP 4 = IF |
|
|
DUP 4 = IF |
|
|
DROP |
|
|
DROP |
|
|
( We're finished interpreting ) |
|
|
( We're finished interpreting ) |
|
|
BLKC<* @ 0x0c RAM+ ! |
|
|
|
|
|
C< |
|
|
|
|
|
|
|
|
EXIT! |
|
|
THEN |
|
|
THEN |
|
|
; |
|
|
; |
|
|
|
|
|
|
|
|
: LOAD |
|
|
: LOAD |
|
|
|
|
|
( save BLK>, CINPTR and boot< ptr to RSP ) |
|
|
|
|
|
BLK> @ >R |
|
|
|
|
|
0x0c RAM+ @ >R |
|
|
|
|
|
0x2e RAM+ @ >R |
|
|
BLK@ |
|
|
BLK@ |
|
|
( 2e == BOOT C< PTR ) |
|
|
|
|
|
|
|
|
( Point to beginning of BLK ) |
|
|
BLK( 0x2e RAM+ ! |
|
|
BLK( 0x2e RAM+ ! |
|
|
( Save current C< ptr ) |
|
|
|
|
|
0x0c RAM+ @ BLKC<* ! |
|
|
|
|
|
( 0c == CINPTR ) |
|
|
( 0c == CINPTR ) |
|
|
['] _ 0x0c RAM+ ! |
|
|
['] _ 0x0c RAM+ ! |
|
|
|
|
|
INTERPRET |
|
|
|
|
|
R> 0x2e RAM+ ! |
|
|
|
|
|
( Before we restore CINPTR, are we restoring it to "_"? |
|
|
|
|
|
if yes, it means we're in a nested LOAD which means we |
|
|
|
|
|
should also load back the saved BLK>. Otherwise, we can |
|
|
|
|
|
ignore the BLK> from RSP. ) |
|
|
|
|
|
I 0x0c RAM+ @ = IF |
|
|
|
|
|
( nested load ) |
|
|
|
|
|
R> DROP ( CINPTR ) |
|
|
|
|
|
R> BLK@ |
|
|
|
|
|
ELSE |
|
|
|
|
|
( not nested ) |
|
|
|
|
|
R> 0x0c RAM+ ! |
|
|
|
|
|
R> DROP ( BLK> ) |
|
|
|
|
|
THEN |
|
|
; |
|
|
; |