First function application: Block explorer!
Dieser Commit ist enthalten in:
Ursprung
5d4155aa32
Commit
4eca827d36
3
blk/000
3
blk/000
@ -3,7 +3,8 @@ Collapse OS file system
|
||||
This is a Forth-style filesystems which is very simple. It is a
|
||||
list of 1024 bytes block, organised in 16 lines of 64 columns
|
||||
each. You refer to blocks by numbers. You show them with LIST.
|
||||
You interpret them with LOAD.
|
||||
You interpret them with LOAD. For a convenient way to browse
|
||||
blocks, see Block Explorer at B100.
|
||||
|
||||
Conventions: When you see "(cont.)" at the bottom right of a
|
||||
block, it means that the next block continues the same kind of
|
||||
|
2
blk/100
2
blk/100
@ -7,4 +7,4 @@ USAGE: When loaded, the Forth interpreter is replaced by the
|
||||
explorer interpreter. Typing "Q" quits the program.
|
||||
|
||||
Typing a decimal number followed by space or return lists the
|
||||
contents of that block.
|
||||
contents of that block. B for previous block, N for next.
|
||||
|
16
blk/102
16
blk/102
@ -1,2 +1,14 @@
|
||||
: foo ." Hello world! " 42 . ;
|
||||
foo
|
||||
103 LOAD
|
||||
VARIABLE _K
|
||||
|
||||
: PGM
|
||||
100 _LIST
|
||||
BEGIN
|
||||
KEY
|
||||
DUP 'Q' = IF DROP EXIT THEN
|
||||
DUP 58 ( '9'+1 ) < IF _NUM
|
||||
ELSE
|
||||
_K ! _K (find) IF EXECUTE THEN
|
||||
THEN
|
||||
AGAIN
|
||||
; PGM
|
||||
|
10
blk/103
10
blk/103
@ -1 +1,9 @@
|
||||
42 . 102 LOAD 43 .
|
||||
VARIABLE ACC
|
||||
: _LIST ." Block " DUP . CRLF LIST ;
|
||||
: _NUM
|
||||
ACC @ SWAP _pdacc
|
||||
IF _LIST 0 THEN
|
||||
ACC !
|
||||
;
|
||||
: B BLK> @ 1- DUP BLK> ! _LIST ;
|
||||
: N BLK> @ 1+ DUP BLK> ! _LIST ;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren