mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 16:38:06 +11:00
Block explorer upgraded to block editor!
This commit is contained in:
parent
5067d40e3b
commit
57e20f0532
2
blk/000
2
blk/000
@ -4,7 +4,7 @@ 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. For a convenient way to browse
|
||||
blocks, see Block Explorer at B100.
|
||||
blocks, see Block editor 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/001
2
blk/001
@ -1,4 +1,4 @@
|
||||
MASTER INDEX
|
||||
|
||||
3 Usage 30 Dictionary
|
||||
70 Implementation notes 100 Block explorer
|
||||
70 Implementation notes 100 Block editor
|
||||
|
18
blk/100
18
blk/100
@ -1,10 +1,16 @@
|
||||
Block explorer
|
||||
Block editor
|
||||
|
||||
This is an application to conveniently browse the contents of
|
||||
the disk blocks. You can launch it with "102 LOAD".
|
||||
the disk blocks and edit them. You can load it with "102 LOAD".
|
||||
|
||||
USAGE: When loaded, the Forth interpreter is replaced by the
|
||||
explorer interpreter. Typing "Q" quits the program.
|
||||
Browse mode: If you execute BROWSE, the Forth interpreter is
|
||||
replaced by browser's loop. Typing "Q" quits the browser.
|
||||
|
||||
Typing a decimal number followed by space or return lists the
|
||||
contents of that block. B for previous block, N for next.
|
||||
In this mode, typing a decimal number followed by space or
|
||||
return lists the contents of that block. B for previous block,
|
||||
N for next.
|
||||
|
||||
When not in browse mode, your prompt is a regular Forth prompt
|
||||
with editor words loaded.
|
||||
|
||||
(cont.)
|
||||
|
2
blk/101
Normal file
2
blk/101
Normal file
@ -0,0 +1,2 @@
|
||||
T ( n -- ): select line n for editing.
|
||||
P xxx(return): put typed line on selected line.
|
19
blk/102
19
blk/102
@ -1,14 +1,13 @@
|
||||
103 LOAD
|
||||
VARIABLE _K
|
||||
103 LOAD 104 LOAD
|
||||
|
||||
: PGM
|
||||
: BROWSE
|
||||
100 _LIST
|
||||
BEGIN
|
||||
KEY
|
||||
DUP 'Q' = IF DROP EXIT THEN
|
||||
DUP 58 ( '9'+1 ) < IF _NUM
|
||||
ELSE
|
||||
_K ! _K (find) IF EXECUTE THEN
|
||||
THEN
|
||||
KEY CASE
|
||||
'Q' OF DROP EXIT ENDOF
|
||||
'B' OF B ENDOF
|
||||
'N' OF N ENDOF
|
||||
_NUM
|
||||
ENDCASE
|
||||
AGAIN
|
||||
; PGM
|
||||
;
|
||||
|
5
blk/103
5
blk/103
@ -5,5 +5,6 @@ VARIABLE ACC
|
||||
IF _LIST 0 THEN
|
||||
ACC !
|
||||
;
|
||||
: B BLK> @ 1- DUP BLK> ! _LIST ;
|
||||
: N BLK> @ 1+ DUP BLK> ! _LIST ;
|
||||
: L BLK> @ _LIST ;
|
||||
: B BLK> @ 1- BLK> ! L ;
|
||||
: N BLK> @ 1+ BLK> ! L ;
|
||||
|
13
blk/104
Normal file
13
blk/104
Normal file
@ -0,0 +1,13 @@
|
||||
( Line numbers for the user are 1-based, but in code, they're
|
||||
0-based. )
|
||||
VARIABLE EDPOS
|
||||
: _bpos 64 * BLK( + ;
|
||||
: T 1- DUP EDPOS ! _bpos (print) CRLF ;
|
||||
: P
|
||||
EDPOS @ _bpos C<
|
||||
64 0 DO ( bpos c )
|
||||
DUP 0xd = IF DROP 0 THEN
|
||||
2DUP SWAP I + C!
|
||||
DUP IF DROP C< THEN
|
||||
LOOP
|
||||
;
|
@ -20,7 +20,7 @@
|
||||
;
|
||||
|
||||
: BLK@
|
||||
DUP BLK> = IF DROP EXIT THEN
|
||||
DUP BLK> @ = IF DROP EXIT THEN
|
||||
DUP BLK> ! BLK@* @ EXECUTE
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user