Browse Source

blk: Add LOAD+ and LOADR+

And use them in all places they make sense.
pull/102/head
Virgil Dupras 4 years ago
parent
commit
c494917452
18 changed files with 43 additions and 27 deletions
  1. +5
    -0
      blk/019
  2. +8
    -0
      blk/020
  3. +12
    -10
      blk/064
  4. +3
    -4
      blk/102
  5. +1
    -1
      blk/122
  6. +1
    -1
      blk/142
  7. +1
    -1
      blk/152
  8. +2
    -2
      blk/212
  9. +1
    -1
      blk/262
  10. +1
    -1
      blk/282
  11. +1
    -1
      blk/352
  12. +1
    -1
      blk/357
  13. +1
    -1
      blk/374
  14. +1
    -1
      blk/393
  15. +2
    -0
      blk/459
  16. +1
    -1
      blk/492
  17. +1
    -1
      blk/498
  18. BIN
      emul/forth.bin

+ 5
- 0
blk/019 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"
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
- 0
blk/020 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.

+ 12
- 10
blk/064 View File

@@ -1,15 +1,17 @@
Disk

BLK> -- a Address of the current block variable.
BLK( -- a Beginning addr of blk buf.
BLK) -- a Ending addr of blk buf.
COPY s d -- Copy contents of s block to d block.
FLUSH -- Write current block to disk if dirty.
LIST n -- Prints the contents of the block n on screen
in the form of 16 lines of 64 columns.
LOAD n -- Interprets Forth code from block n
LOADR n1 n2 -- Load block range between n1 and n2, inclusive.
WIPE -- Empties current block
BLK> -- a Address of the current block variable.
BLK( -- a Beginning addr of blk buf.
BLK) -- a Ending addr of blk buf.
COPY s d -- Copy contents of s block to d block.
FLUSH -- Write current block to disk if dirty.
LIST n -- Prints the contents of the block n on screen
in the form of 16 lines of 64 columns.
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 -- Relative ranged load.
WIPE -- Empties current block





+ 3
- 4
blk/102 View File

@@ -1,9 +1,8 @@
152 LOAD ( extras )
103 107 LOADR
50 LOAD+ ( B152, extras )
1 5 LOADR+

: BROWSE
100 _LIST
BEGIN
L BEGIN
KEY CASE
'Q' OF EXIT ENDOF
'B' OF B ENDOF


+ 1
- 1
blk/122 View File

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

+ 1
- 1
blk/142 View File

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

+ 1
- 1
blk/152 View File

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

+ 2
- 2
blk/212 View File

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

+ 1
- 1
blk/262 View File

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

+ 1
- 1
blk/282 View File

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

+ 1
- 1
blk/352 View File

@@ -11,5 +11,5 @@ ACIA_MEM
+4 ACIA(
+6 ACIA) )

353 355 LOADR
1 3 LOADR+


+ 1
- 1
blk/357 View File

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

+ 1
- 1
blk/374 View File

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

+ 1
- 1
blk/393 View File

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

+ 2
- 0
blk/459 View File

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

+ 1
- 1
blk/492 View File

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

+ 1
- 1
blk/498 View File

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

BIN
emul/forth.bin View File


Loading…
Cancel
Save