SamCoVT / TaliForth2

A Subroutine Threaded Code (STC) ANSI-like Forth for the 65c02
Other
28 stars 4 forks source link

Simplify platform customization #87

Closed patricksurry closed 2 months ago

patricksurry commented 2 months ago

One thing that is missing (that might be helpful for #86, and I think it was brought up by a user some time ago) is that the forth_words and user_words are not tied to the platform, so it's not possible to have versions of those for one platform without them being used for other platforms as well.

Another feature that might be useful would be a TURNKEY word that is run right at the end of COLD and could be overridden in assembly (or Forth by redefining it). That would allow things like installing the block vectors without having to run a forth word interactively to do it.

An alternative to TURNKEY for installing the block vectors automatically would be use conditional compilation to either use the existing routine (that prints an error) or the user provided routines (if they are provided). I like the idea of it working "out of the box" without having to run a word to set the vectors, and others could use it in their platform file by naming their block I/O routines with the special names (like kernel_block_read and kernel_block_write?)

The only downside I can see is that they are a little more difficult to write as they will need to access the Forth stack. The other kernel routines just use A to pass the data. The c65 platform file could serve as an example of how to do it.