Compare commits

..

No commits in common. "c494917452010349bde2877cfab7404199bb6c79" and "986a40d3e2328738e2583793d8188b8704a3f3f3" have entirely different histories.

20 changed files with 28 additions and 71 deletions

View File

@ -13,4 +13,4 @@ Contents
4 Number literals 6 Compilation vs meta-comp.
8 Interpreter I/O 11 Signed-ness
14 Addressed devices 17 DOES>
18 Disk blocks

16
blk/018
View File

@ -1,16 +0,0 @@
Disk blocks
Disk blocks are Collapse OS' main access to permanent storage.
The system is exceedingly simple: blocks are contiguous
chunks of 1024 bytes each living on some permanent media such
as floppy disks or SD cards. They are mostly used for text,
either informational or source code, which is organized into
16 lines of 64 characters each.
Blocks are referred to by number, 0-indexed. They are read
through BLK@ and written through BLK!. When a block is read,
its 1024 bytes content is copied to an in-memory buffer
starting at BLK( and ending at BLK). Those read/write
operations are often implicit. For example, LIST calls BLK@.
(cont.)

16
blk/019
View File

@ -1,16 +0,0 @@
When a word modifies the buffer, it sets the buffer as dirty
by calling BLK!!. BLK@ checks, before it reads its buffer,
whether the current buffer is dirty and implicitly calls BLK!
when it is.
The index of the block currently in memory is kept in BLK>.
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.)

View File

@ -1,8 +0,0 @@
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
View File

@ -1,17 +1,15 @@
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
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
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.