mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 12:38:05 +11:00
blk: Add LOAD+ and LOADR+
And use them in all places they make sense.
This commit is contained in:
parent
3c2e0dd9df
commit
c494917452
5
blk/019
5
blk/019
@ -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
blk/020
Normal file
8
blk/020
Normal 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.
|
22
blk/064
22
blk/064
@ -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
|
||||
|
||||
|
||||
|
||||
|
7
blk/102
7
blk/102
@ -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
|
||||
|
2
blk/152
2
blk/152
@ -1,3 +1,3 @@
|
||||
'? CASE NOT [IF]
|
||||
153 157 LOADR
|
||||
1 5 LOADR+
|
||||
[THEN] DROP ( from '? )
|
||||
|
2
blk/393
2
blk/393
@ -12,4 +12,4 @@
|
||||
0 0x08 RAM+ ! ( 08 == C<* override )
|
||||
LIT< INTERPRET (find) DROP EXECUTE
|
||||
;
|
||||
394 413 LOADR
|
||||
1 20 LOADR+
|
||||
|
2
blk/459
2
blk/459
@ -1,2 +1,4 @@
|
||||
: LOAD+ BLK> @ + LOAD ;
|
||||
( b1 b2 -- )
|
||||
: LOADR 1+ SWAP DO I DUP . NL LOAD LOOP ;
|
||||
: LOADR+ BLK> @ + SWAP BLK> @ + SWAP LOADR ;
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user