瀏覽代碼

Block explorer upgraded to block editor!

pull/102/head
Virgil Dupras 4 年之前
父節點
當前提交
57e20f0532
共有 8 個檔案被更改,包括 42 行新增21 行删除
  1. +1
    -1
      blk/000
  2. +1
    -1
      blk/001
  3. +12
    -6
      blk/100
  4. +2
    -0
      blk/101
  5. +9
    -10
      blk/102
  6. +3
    -2
      blk/103
  7. +13
    -0
      blk/104
  8. +1
    -1
      forth/blk.fs

+ 1
- 1
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


+ 1
- 1
blk/001 查看文件

@@ -1,4 +1,4 @@
MASTER INDEX

3 Usage 30 Dictionary
70 Implementation notes 100 Block explorer
70 Implementation notes 100 Block editor

+ 12
- 6
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
- 0
blk/101 查看文件

@@ -0,0 +1,2 @@
T ( n -- ): select line n for editing.
P xxx(return): put typed line on selected line.

+ 9
- 10
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
;

+ 3
- 2
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
- 0
blk/104 查看文件

@@ -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
;

+ 1
- 1
forth/blk.fs 查看文件

@@ -20,7 +20,7 @@
;

: BLK@
DUP BLK> = IF DROP EXIT THEN
DUP BLK> @ = IF DROP EXIT THEN
DUP BLK> ! BLK@* @ EXECUTE
;



Loading…
取消
儲存