Tuesday 25 September 2018

And another version

I've actually rewritten it all, again. I like the bootstrapping version, but not the way it's implemented. So I've rewritten the kernel (a few core functions and the compiler) but for the Next not the Spectrum ; it now won't run on a Spectrum, except maybe a Spectrum 128.

This gives vastly more space to work with. I'm using 16k paging, largely with the 128 in mind, so it pages 16k chunks in and out at $C000-$FFFF. Two 16k pages are dedicated to the now physically seperate dictionaries, and cross page calling is now working.

This is okay, except that it's much slower, because it has to switch pages then switch to the routine and then switch back again. It's best really to write in modules that perform specific tasks - which is what you do anyway, rather than having monolithic code bases and relying on the compiler (which figures out when it does CALL and when it page swaps).

But you should do this anyway.

Otherwise it's the same, except the C register is now IX not BC (I wanted BC for the cross page calling mechanism), so the code tried to date just pings into place. It's actually pretty easy to bootstrap this system, even by FORTH standards.

Not quite done, not coded 'variable' yet (it would be possible to do this in M and it would work fine but its cleaner just to code it seperately) and a few other bits and pieces, but then the other modules I wrote should just ping into place. Hopefully :)

It now has a seperate home at https://github.com/paulscottrobson/mnext

No comments:

Post a Comment