uho / preForth

a minimalistic Forth kernel that can bootstrap
GNU General Public License v3.0
74 stars 8 forks source link

I386 improvements #8

Open nickd4 opened 2 years ago

nickd4 commented 2 years ago

hi, I've been hacking on this as instructed :)

It's mainly code cleanup, I did this because I created a Z80 port and in the process of writing the Z80 code I noticed various things that I wanted to change. You can see the Z80 port at https://github.com/nickd4/preForth/tree/z80_port and it works well but it also needs code cleanup which I will do soon. Eventually I'd like the master branch to build all ports under distinct filenames, and possibly build some other support files like the assembler and emulator (which are needed for bootstrapping).

So for the time being I'm simply submitting improvements to the i386 port. They are well summarized by the commit messages, which I have listed in the below list along with some further explanatory text about each change and why I wanted to make it.

Thanks for creating preForth/seedForth, they are really brilliant. A while ago I was trying to port hForth (an MS-DOS Forth) or one of its relatives to Z80, but I became discouraged because of the large amount of hand-compiling of high-level Forth words I would need to do for initial bootstrap, plus the issue of retargeting the 8086 Forth assembler to Z80. Your ideas neatly solve both problems and meant I could get the Z80 Forth up and running within a day or two -- including the time taken to convert things from indirect threaded to direct threaded (good for Z80 but less good for i386) and experiment with dodoes and so on.