From c16c5c98ce56b7707adad3f71bdbd095feaf0dbe Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 9 Jun 2020 22:55:42 -0400 Subject: [PATCH] Improve usage docs --- blk/000 | 4 ++-- blk/003 | 4 ++-- blk/005 | 6 +++--- blk/006 | 6 ++---- blk/008 | 2 +- blk/014 | 16 ---------------- blk/015 | 16 ---------------- blk/016 | 16 ---------------- blk/017 | 2 +- blk/120 | 14 +++++++------- blk/121 | 12 ++++++------ blk/122 | 12 ++++++------ blk/123 | 14 ++++++-------- 13 files changed, 36 insertions(+), 88 deletions(-) delete mode 100644 blk/014 delete mode 100644 blk/015 delete mode 100644 blk/016 diff --git a/blk/000 b/blk/000 index 3bf988c..6ffaeb0 100644 --- a/blk/000 +++ b/blk/000 @@ -12,5 +12,5 @@ block, it means that the next block continues the same kind of contents. Block numbers are abbreviated with prefix "B". "BX" means "block X". -The master index of this filesystem is at B1. The Block editor -at B100 is a convenient way to navigate blocks. +The master index of this filesystem is at B1. You can navi- +gate and edit blocks with the Visual Editor at B120. diff --git a/blk/003 b/blk/003 index f79a3ae..34e6f54 100644 --- a/blk/003 +++ b/blk/003 @@ -12,5 +12,5 @@ Contents 5 Number literals 6 Compilation vs meta-comp. 8 Interpreter I/O 11 Signed-ness -14 Addressed devices 17 DOES> -18 Disk blocks (cont.) +17 DOES> 18 Disk blocks + (cont.) diff --git a/blk/005 b/blk/005 index 28e2307..4be0766 100644 --- a/blk/005 +++ b/blk/005 @@ -1,8 +1,8 @@ Number literals -Traditional Forth often use HEX/DEC switches to go from decimal -to hexadecimal parsing. Collapse OS parses literals in a way -that is closer to C. +Traditional Forth often uses HEX/DEC switches to go from deci- +mal to hexadecimal parsing. Collapse OS parses literals in a +way that is closer to C. Straight numbers are decimals, numbers starting with "0x" are hexadecimals (example "0x12ef"), "0b" prefixes indicate diff --git a/blk/006 b/blk/006 index 7c19250..b56c956 100644 --- a/blk/006 +++ b/blk/006 @@ -1,8 +1,8 @@ Compilation vs meta-compilation Compilation vs meta-compilation. When you compile a word with -"[COMPILE] foo", its straightforward: It writes down to HERE -wither the address of the word or a number literal. +"[COMPILE] foo", it's straightforward: It writes the address +of word foo to HERE. When you *meta* compile, it's a bit more mind blowing. It fetches the address of the word specified by the caller, then @@ -12,5 +12,3 @@ writes that number as a literal, followed by a reference to Example: ": foo [COMPILE] bar;" is the equivalent of ": foo bar ;" if bar is not an immediate. However, ": foo COMPILE bar ;" is the equivalent of ": foo ['] bar , ;". Got it? - -Meta-compile only works with real words, not number literals. diff --git a/blk/008 b/blk/008 index 2b03ff5..bb6b702 100644 --- a/blk/008 +++ b/blk/008 @@ -8,7 +8,7 @@ During normal operations, C< is simply a buffered layer over KEY, which has the same behavior (but unbuffered). Before yielding any character, the C< routine fetches a whole line from KEY, puts it in a buffer, then yields the buffered line, -one character at once. +one character at a time. Both C< and KEY can be overridden by setting an alternate routine at the proper RAM offset (see B80). For example, C< diff --git a/blk/014 b/blk/014 deleted file mode 100644 index 27bde4b..0000000 --- a/blk/014 +++ /dev/null @@ -1,16 +0,0 @@ -Addressed devices - -The adev unit provides a simple but powerful abstraction over -C@ and C!: A@ and A!. These work the same way as C@ and C! (but -for performance reasons, aren't used in core words), but are -indirect calls. - -Upon initialization, the default to C@ and C!, but can be set -to any word through A@* and A!*. - -On top of that, it provides a few core-like words such as -AMOVE. - -Let's demonstrate its use through a toy example: - - (cont.) diff --git a/blk/015 b/blk/015 deleted file mode 100644 index 898fa32..0000000 --- a/blk/015 +++ /dev/null @@ -1,16 +0,0 @@ -(cont.) - > : F! SWAP 1 + SWAP C! ; - > 8 H@ DUMP - :54 0000 0000 0000 0000 ........ - > 9 H@ A! - > 8 H@ DUMP - :54 0900 0000 0000 0000 ........ - > ' F! A!* ! - > 9 H@ 1 + A! - > 8 H@ DUMP - :54 090a 0000 0000 0000 ........ - > H@ H@ 2 + 2 AMOVE - > 8 H@ DUMP - :54 090a 0a0b 0000 0000 ........ - > - (cont.) diff --git a/blk/016 b/blk/016 deleted file mode 100644 index 01a8b8e..0000000 --- a/blk/016 +++ /dev/null @@ -1,16 +0,0 @@ -(cont.) Of course, you might want to end up using adev in this -kind of ad-hoc way to have some kind of mapping function, but -what you'll mostly want to to is to plug device drivers into -those words. - - - - - - - - - - - - diff --git a/blk/017 b/blk/017 index 2be2060..1930547 100644 --- a/blk/017 +++ b/blk/017 @@ -2,7 +2,7 @@ DOES> Used inside a colon definition that itself uses CREATE, DOES> transforms that newly created word into a "does cell", that is, -a regular cell ( when called, puts the cell's addr on PS), but +a regular cell (when called, puts the cell's addr on PS), but right after that, it executes words that appear after the DOES>. diff --git a/blk/120 b/blk/120 index a85c126..ce24149 100644 --- a/blk/120 +++ b/blk/120 @@ -2,15 +2,15 @@ Visual Editor This editor, unlike the Block Editor (B100), is grid-based instead of being command-based. It requires the AT-XY, COLS -and LINES words to be implemented. +and LINES words to be implemented. If you don't have those, +use the Block Editor. It is loaded with "125 LOAD" and invoked with "VE". Note that -this also fully loads the Block Editor (B100). +this also fully loads the Block Editor. -This editor uses 17 lines. The top line is the status line and -the 16 others are contents lines. The content shown is that -of the currently selected block. +This editor uses 19 lines. The top line is the status line and +it's followed by 2 lines showing the contents of IBUF and +FBUF (see B100). There are then 16 contents lines. The contents +shown is that of the currently selected block. -All keystrokes are directly interpreted by VE and have the -effect described below. (cont.) diff --git a/blk/121 b/blk/121 index f159a96..0878560 100644 --- a/blk/121 +++ b/blk/121 @@ -1,3 +1,6 @@ +All keystrokes are directly interpreted by VE and have the +effect described below. + Pressing a 0-9 digit accumulates that digit into what is named the "modifier". That modifier affects the behavior of many keystokes described below. The modifier starts at zero, but @@ -5,12 +8,9 @@ most commands interpret a zero as a 1 so that they can have an effect. 'g' selects the block specified by the modifier as the current -block. Any change madde to the previously selected block is +block. Any change made to the previously selected block is saved beforehand. -'[' and ']' advance the selected block by modifier. +'[' and ']' advances the selected block by "modifier". -';' resets the modifier. 'q' quits. - -'h' and 'l' move the cursor by "modifier" characters. 'j' and -'k', by lines. (cont.) +';' resets the modifier. 'q' quits. (cont.) diff --git a/blk/122 b/blk/122 index d0a1fa2..0e300ce 100644 --- a/blk/122 +++ b/blk/122 @@ -1,16 +1,16 @@ +'h' and 'l' move the cursor by "modifier" characters. 'j' and +'k', by lines. + 'H' goes to the beginning of the line, 'L' to the end. -'w' moves forward by a word. 'b' moves backward by a word. -'W' moves to end-of-word. 'B' moves backward to end-of-word. +'w' moves forward by "modifier" words. 'b' moves backward. +'W' moves to end-of-word. 'B', backwards. -'I', 'F' and 'E' invoke the corresponding command from the +'I', 'F', 'X' and 'E' invoke the corresponding command from the Block Editor (B100). Refer to documentation there. 'o' inserts a blank line after the cursor. 'O', before. 'D' deletes "modifier" lines at the cursor. - - - (cont.) diff --git a/blk/123 b/blk/123 index 7fe46c8..a4897dd 100644 --- a/blk/123 +++ b/blk/123 @@ -1,11 +1,9 @@ -'f' puts the contents of your previous cursor movement into the -find buffer. If that movement was a forward movement, it brings -the cursor back where it was. This allows for an efficient -combination of movements and 'E'. For example, if you want to -delete the next word, you type 'w', then 'f', then check your -"F" buffer to be sure, then press 'E'. - -'X' deletes "modifier" characters following cursor. +'f' puts the contents of your previous cursor movement into +FBUF. If that movement was a forward movement, it brings the +cursor back where it was. This allows for an efficient combi- +nation of movements and 'E'. For example, if you want to delete +the next word, you type 'w', then 'f', then check your FBUF to +be sure, then press 'E'. 'R' goes into replace mode at current cursor position. Following keystrokes replace current character and advance