blk: Add LOAD+ and LOADR+

And use them in all places they make sense.
This commit is contained in:
Virgil Dupras 2020-05-04 21:43:48 -04:00
parent 3c2e0dd9df
commit c494917452
18 changed files with 43 additions and 27 deletions

View File

@ -9,3 +9,8 @@ Many blocks contain code. That code can be interpreted through
LOAD. Programs stored in blocks frequently have "loader blocks" LOAD. Programs stored in blocks frequently have "loader blocks"
that take care of loading all blocks relevant to the program. that take care of loading all blocks relevant to the program.
Blocks spanning multipls disks are tricky. If your media isn't
large enough to hold all Collapse OS blocks in one unit, you'll
have to make it span multiple disks. Block reference in
informational texts aren't a problem: When you swap your disk,
you mentally adjust the block number you fetch. (cont.)

8
blk/020 Normal file
View File

@ -0,0 +1,8 @@
However, absolute LOAD operations in Collapse OS aren't aware
of disk spanning and will not work properly in your spanned
system.
Although the usage of absolute LOAD calls are minimally used
(relative LOADs are preferred), they are sometimes unavoidable.
When you span Collapse OS over multiple disks, don't forget to
adjust those absolute LOADs.

View File

@ -8,7 +8,9 @@ FLUSH -- Write current block to disk if dirty.
LIST n -- Prints the contents of the block n on screen LIST n -- Prints the contents of the block n on screen
in the form of 16 lines of 64 columns. in the form of 16 lines of 64 columns.
LOAD n -- Interprets Forth code from block n LOAD n -- Interprets Forth code from block n
LOAD+ n -- Relative load. Loads active block + n.
LOADR n1 n2 -- Load block range between n1 and n2, inclusive. LOADR n1 n2 -- Load block range between n1 and n2, inclusive.
LOADR+ n1 n2 -- Relative ranged load.
WIPE -- Empties current block WIPE -- Empties current block

View File

@ -1,9 +1,8 @@
152 LOAD ( extras ) 50 LOAD+ ( B152, extras )
103 107 LOADR 1 5 LOADR+
: BROWSE : BROWSE
100 _LIST L BEGIN
BEGIN
KEY CASE KEY CASE
'Q' OF EXIT ENDOF 'Q' OF EXIT ENDOF
'B' OF B ENDOF 'B' OF B ENDOF

View File

@ -1 +1 @@
123 131 LOADR 1 9 LOADR+

View File

@ -1 +1 @@
143 144 LOADR 1 2 LOADR+

View File

@ -1,3 +1,3 @@
'? CASE NOT [IF] '? CASE NOT [IF]
153 157 LOADR 1 5 LOADR+
[THEN] DROP ( from '? ) [THEN] DROP ( from '? )

View File

@ -1,2 +1,2 @@
213 LOAD Z80A$ 1 LOAD+ Z80A$
215 249 LOADR 3 37 LOADR+

View File

@ -1 +1 @@
263 LOAD 265 LOAD 268 LOAD 269 LOAD 1 LOAD+ 3 LOAD+ 6 LOAD+ 7 LOAD+

View File

@ -1 +1 @@
283 333 LOADR 1 51 LOADR+

View File

@ -11,5 +11,5 @@ ACIA_MEM
+4 ACIA( +4 ACIA(
+6 ACIA) ) +6 ACIA) )
353 355 LOADR 1 3 LOADR+

View File

@ -1 +1 @@
358 360 LOADR 1 3 LOADR+

View File

@ -13,4 +13,4 @@
DUP 20 = UNTIL DUP 20 = UNTIL
DROP 0xff DROP 0xff
; ;
375 386 LOADR 1 12 LOADR+

View File

@ -12,4 +12,4 @@
0 0x08 RAM+ ! ( 08 == C<* override ) 0 0x08 RAM+ ! ( 08 == C<* override )
LIT< INTERPRET (find) DROP EXECUTE LIT< INTERPRET (find) DROP EXECUTE
; ;
394 413 LOADR 1 20 LOADR+

View File

@ -1,2 +1,4 @@
: LOAD+ BLK> @ + LOAD ;
( b1 b2 -- ) ( b1 b2 -- )
: LOADR 1+ SWAP DO I DUP . NL LOAD LOOP ; : LOADR 1+ SWAP DO I DUP . NL LOAD LOOP ;
: LOADR+ BLK> @ + SWAP BLK> @ + SWAP LOADR ;

View File

@ -1 +1 @@
493 497 LOADR 1 5 LOADR+

View File

@ -1 +1 @@
499 500 LOADR 1 2 LOADR+

Binary file not shown.