Solo Forth development history in 2016-11

Description of the page content

Solo Forth development history in 2016-11.

Tags:

2016-11-10

Fix ecount, eplace, euppers; add etype. Now all extra-memory words page in the default bank at the end, and return and use extra-memory addresses, not actual bank addresses. This is more logical and makes those words easier to use in any context.

2016-11-11

Fix ?previous-bank.

Improve ?previous-bank to check any decrement.

2016-11-12

Improve ?next-bank to check any increment.

Fix results of ?next-bank and ?previous-bank. When detecting decrements or increments larger than one byte, the result address must include the correspondent offset in the previous/next bank.

Fix the extra-memory version of name>string.

2016-11-13

Finish extra-memory variant of >name.

Add extra-memory alternative to lex?.

Rename "names pointer" to "headers pointer". The whole header of the definition is stored at the pointed address, not just its name.

Rename all extra-memory words. The new convention makes word naming regular and clearer: "far" is used as a prefix for words that work with far-memory addresses; "far-" is used as usual in the compound name far-banks; far is the name of the address converter and memory pager.

Simplify home. No need for specific versions of home for the screen modes. Only at-xy has to be reconfigured by the screen modes, if needed.

Fix conditional compilation of alias!.

Remove bank fetch/store words if far-memory is on.

Improve the address register module. The code still used direct jumps to pushhl instead of jppushhl, which is faster with no size penalty.

Remove from the kernel unused split and join. They were used in the high-level versions of the far-memory words.

Try indexer and document it; improve README. The indexer did not work with the old 16 KiB "system bank" used to store the definition headers, because the index occupied 12 KiB, what, added to the 5 KiB used by the kernel definitions, filled the bank. After implementing the new 64 KiB "far-memory" method, the indexer works fine.

Its usage has been documented in the source and the README.

Rename pending far-memory labels and names.

2016-11-14

Improve documentation of the assert( tools.

Document the ~~ debugging tool.

Rename code-field, to call, in assembler. The old code-field,, needed in the kernel, does exactly the same as call, in the z80-asm, assembler. So it has been renamed, moved to the assembler word list and removed from the assembler.

Compact the assemblers, saving one block each.

Fix requiring <=>.

Remove useless copy of sm/rem from the library.

Move 8* from the assemblers to the operators.

2016-11-15

Make all buffers contiguous. Now the circular string buffer can be configured to use the disk buffer and the terminal input buffer as extra space.

Adapt the first cold entry to far memory.

Update TO-DO and modify VERSIONS.

2016-11-16

Let code words use far-memory kernel routines. Three constants are defined in the library, with the addresses of the basic routines needed to manage the far memory:

( farhl questionnextbank questionpreviousbank )

get-current also assembler definitions

[unneeded] farhl ?\ ' far 2+ @ constant farhl  ( -- a )

  \ doc{
  \
  \ farhl  ( -- a )
  \
  \ Address of the `far.hl` routine of the kernel, which
  \ converts the far-memory address ($0000..$FFFF) hold in the
  \ HL register to its actual equivalent ($C000..$FFFF) and
  \ pages in the correspondent memory bank.
  \
  \ This is the routine called by `far`. `farhl` is used in
  \ code words.
  \
  \ Input:
  \   HL = far-memory address ($0000..$FFFF)
  \
  \ Output:
  \   HL = actual memory address ($C000..$FFFF)
  \   A DE corrupted
  \
  \ See: `far`.
  \
  \ }doc

[unneeded] questionnextbank
?\ ' ?next-bank 2+ @ constant questionnextbank  ( -- a )

  \ doc{
  \
  \ questionnextbank  ( -- a )
  \
  \ Address of the `question_next_bank` routine of the kernel,
  \ which does the followig:
  \
  \ If the actual far-memory address ($C000..$FFFF) in the HL
  \ register has increased to the next bank ($0000..$3FFF),
  \ convert it to the correspondent actual address
  \ ($C000..$FFFF) in the next bank and page in the next bank,
  \ else do nothing.
  \
  \ This is the routine called by `?next-bank`.
  \ `questionnextbank` is used in code words.
  \
  \ Input:
  \   HL = address in a paged bank ($C000..$FFFF) or higher
  \   ($0000..$BFFF).
  \ Output when HL is above the paged bank:
  \   HL = correspondent address in the next bank, which is paged in
  \   A corrupted
  \   D = 0
  \   E = bank
  \ Output when HL is an address in a paged bank:
  \   HL preserved
  \   A corrupted
  \
  \ See: `?next-bank`.
  \
  \ }doc

[unneeded] questionpreviousbank
?\ ' ?previous-bank 2+ @ constant questionpreviousbank  ( -- a)

  \ doc{
  \
  \ questionpreviousbank  ( -- a )
  \
  \ Address of the `question_previous_bank` routine of the
  \ kernel, which does the followig:
  \
  \ If the actual far-memory address ($C000..$FFFF) in the HL
  \ register has decreased to the previous bank ($8000..$BFFF),
  \ convert it to the correspondent actual address
  \ ($C000..$FFFF) in the previous bank and page in the next
  \ bank, else do nothing.
  \
  \ This is the routine called by `?previous-bank`.
  \ `questionpreviousbank` is used in code words.
  \
  \ Input:
  \   HL = address in a paged bank ($C000..$FFFF) or lower
  \   ($8000..$BFFF).
  \ Output when HL is below the paged bank:
  \   HL = correspondent address in the previous bank, which is paged in
  \   A corrupted
  \   D = 0
  \   E = bank
  \ Output when HL is an address in a paged bank:
  \   HL preserved
  \   A corrupted
  \
  \ See: `?previous-bank`.
  \
  \ }doc

previous set-current

Add far2@, far@+, farc@+, far2@+.

Add far2!, far+!, farc+!.

Add move>far, move<far, cmove>far, cmove<far:

( move>far move<far cmove>far cmove<far )

need ?(

[unneeded] move>far ?(
: move>far  ( a1 a2 len -- )
  2* bounds ?do  dup @ i far! cell+
            cell +loop  drop  ;  exit ?)

  \ doc{
  \
  \ move>far  ( a1 a2 len -- )
  \
  \ If _len_ is greater than zero, copy _len_ consecutive
  \ cells from main-memory address _a1_ to far-memory
  \ address _a2_.
  \
  \ }doc

[unneeded] move<far ?(
: move<far  ( a1 a2 len -- )
  2* bounds ?do  dup far@ i ! cell+
            cell +loop  drop  ;  exit ?)

  \ doc{
  \
  \ move<far  ( a1 a2 len -- )
  \
  \ If _len_ is greater than zero, copy _len_ consecutive
  \ cells from far-memory address _a1_ to main-memory
  \ address _a2_.
  \
  \ }doc

[unneeded] cmove>far ?(
: cmove>far  ( ca1 ca2 len -- )
  bounds ?do  dup c@ i farc! char+  loop  drop  ;  exit ?)

  \ doc{
  \
  \ cmove>far  ( ca1 ca2 len -- )
  \
  \ If _len_ is greater than zero, copy _len_ consecutive
  \ characters from main-memory address _ca1_ to far-memory
  \ address _ca2_.
  \
  \ }doc

[unneeded] cmove<far ?(
: cmove<far  ( ca1 ca2 len -- )
  bounds ?do  dup farc@ i c! char+  loop  drop  ;  exit ?)

  \ doc{
  \
  \ cmove<far  ( ca1 ca2 len -- )
  \
  \ If _len_ is greater than zero, copy _len_ consecutive
  \ characters from far-memory address _ca1_ to main-memory
  \ address _ca2_.
  \
  \ }doc

Improve documentation of dump and wdump.

Add fartype-ascii, fardump, farwdump.

Add farallot.

Update Vim syntax file.

Improve the default case with alias:

( case )

  \ Credit:
  \
  \ Code adapted and modified from eForth.

  \ When `alias` is already defined,
  \ this version uses 40 bytes; else it uses 52 bytes.

[defined] alias dup 0=
  ?\   ' 0 alias case
  ?\  0 constant case
  immediate compile-only

: of
  \ Compilation: ( -- orig )
  \ Run-time: ( x1 x2 -- )
  postpone over  postpone =  postpone if  postpone drop
  ; immediate compile-only

[defined] alias dup 0=
  ?\ ' else alias endof  ( orig1 -- orig2 )
  ?\ : endof  ( orig1 -- orig2 ) postpone else  ;
  immediate compile-only

: endcase
  \ Compilation: ( 0 orig1..orign -- )
  \ Run-time: ( x -- )
  postpone drop  begin  ?dup  while  postpone then  repeat
  ; immediate compile-only

Release version 0.11.0.

Fix :noname with the new call,.

2016-11-17

Improve doc of frames!, frames@, reset-frames.

Add const, cconst and 2const.

Update documentation of !>, c!> and 2!>.

Use ?( instead of [if] in the library. Compilation of standard [if] needs more data space and is slower than the conditional comment ?(, which is enough for all the conditional compilation needs of the library. Some modules have been compacted, saving a few blocks.

Fix needing d<>, trim, char, [char], word.

Fix +place.

2016-11-18

Fix documentation of !>, c!> and 2!>.

Adapt module to far memory.

Fix -transient; improve it with limit.

Improve documentation of alias and synonym.

Credit about the "far memory" naming convention.

Improve the user module. Add conditional compilation and improve the documentation.

Reorganize and update the To-Do list.

2016-11-19

Factor jp, from defer.

Split the indexer module. Part of the code can be shared with an alternative indexer under development.

Increase and check the return stack, temporarily.

Remove the debugging code from Tetris for Terminals. The problem was fixed in the kernel.

Update credit of prefix?.

2016-11-20

Add port of blocked editor, under development. An alternative to the fig-Forth editor.

Improve blocked.

Show version-specific background image at startup.

Add farlimit, farunused; update .unused.

Add list-lines; doc&compact list, index, etc..

2016-11-21

Complete documentation of misc strings module.

Reorganize <make/> and <tools/>. Now <make/> contains the programs used by <Makefile>, and <tools/> will contain tools for the Forth programmer.

Improve Specforth editor, mainly doc and clarity.

Adapt, improve and doc the blocked editor.

Extract qx from blocked. The quick index provided by the original blocked can be used as an independent tool, with any editor.

Move contains; add .line#, /line#.

Move .line to its proper module.

Add /block# and .block#.

Fix and improve qx.

2016-11-22

Make qx work in any screen mode.

Move common code and list tools off editors.

Fix and complete documentation of Wong arrays.

2016-11-23

Rename Wong's array to avalue and extend it.

Add avariable, 2avariable, cavariable.

Factor code common to avalue, avariable, etc..

Improve doc and requiring of Noble arrays.

Update Vim syntax file; add Vim ftdetect file.

Document align and aligned.

Rename c!set-bits, c!reset-bits, c!toggle-bits.

Document current and state.

Rename c@test-bits and c@test-bits?.

Rename c!reset-bits to creset also in kernel.

Add bit-array, !bit, @bit.

Start supporting Gforth's mini-oof.

Document mini-oof.

Rename decode to see. The tool is not complete yet, but it fits the description of the standard word see, therefore there's no need to keep its original name.

2016-11-24

Add see-xt, see-body-from.

Factor list-line from list-lines.

Rename -branch to +branch; improve the module. The name was not consistent with ?branch and 0branch.

Add module for branches; add -branch.

Add +if, +while, +until.

Improve needing of 0if, 0while, 0until.

Reorganize indexer modules to add the fly indexer. The current blocks indexer indexes the whole disk in advance, which can be unconvenient in some cases. The new alternative version indexes the blocks on the fly. Both versions share some common code.

Prepare the indexer modules to resume development.

Add max-order and ?order. In order to check the search order in set-order...

Make name<name compatible with far memory.

Improve needing of words, words-like, etc.. New words, words-like, wordlist-words words# and more-words? can be needed individually.

2016-11-25

Move u.r to the library.

Improve needing see-xt and see-body-from.

Make words and family configurable. Sometimes it's useful to see more information in a listing of words. Now the words, wordlist-words and words-like can be configured with a deferred word.

Prepare the implementation of use-fly-index.

Add a configurable resume key to ~~control.

Improve lengths and s+. Rewrite lengths in Z80. Make lengths and s+ independently accessible for need.

Move storer, cstorer, 2storer to a module.

Move const, cconst, 2const to a module.

Improve, factor, document and test [switch.

Document data misc words; make link@ an alias. Document buffer:, enum, cvariable, link@, link,. Make link@ an alias for speed.

Add data:, 2data:, cdata:.

Add quotations: [: and ;].

Add enumcell.

Make [: ;] support recurse.

Improve does> with call,.

Update TO-DO.

2016-11-26

Fix search: empty substring caused crash. When the substring was empty, the Forth IP was not restored before exit.

2016-11-26

Fix Makefile: benchmarks disk images.

Use cell+ cell+ and cell- cell-. They are a little bit faster than [ 2 cells ] literal + and [ 2 cells ] literal - and save one cell.

Improve (located) to detect empty strings. Actually this was a bug: an empty string from need and family was accepted and looked for, and of course it matched the header of the first locatable block of the library.

Improve G+DOS transfer-block with literal.

Remove old get-order and order@ from library.

Move seal to the library.

Add dtimes; rewrite d- with Z80 opcodes. dtimes was not finished yet because of the differences between ?do loop and dfor step. Now times and dtimes work the same way.

Move catch to the library.

Combine small control structures into one module.

Combine small definers into one module.

Move fartype to the library.

Move fartype-ascii; document cr, (cr).

Move ?leave to the library.

Improve kernel's comments, doc, first-boot routine.

Fix needing of 0exit.

Remove warnings etc. from the kernel; document. The code was almost ready in the library, especially the alternative behaviours of warn.

Move search-wordlist to the library.

Improve needing and doc of printing words.

Remove blocks, a duplicate of blk/disk.

2016-11-27

Move doer-test to the tests module.

Fix compilation of s\", .\": keep search order.

Remove old unused bank-boundary?.

2016-11-28

Replace scr with lastblk in load and reload.

Improve +field for field zero.

Make +field deferred; add 3 implementations. +field-unopt, +field-opt-0 and +field-opt-0124 are the provided implementations of +field.

Beside, now all words of the Forth-2012 data structures are accessible by need.

2016-11-29

Make negate 6 T faster and 2 B smaller.

Improve ~~control to accept also any resume key.