So, a wee bit of progress since I last wrote a log entry. I can now CREATE a new word and ALLOT a buffer. I can also comma-compile data into the dictionary space. There are enough word header slots in the symbol table to create up to 256 words upon a freshly booted Forth environment.
Since this is a 64-bit Forth running with a 16-bit dictionary space, I have four comma words: , (64-bit) W, (32-bit) H, (16-bit) and C, (8-bit). Similarly, where required, I also have ALIGND, ALIGNW, and ALIGNH for aligning HERE appropriately.
This doesn't sound like much, but it represents a surprising amount of code investment. I had to make a word which properly constructed a RISC-V JAL instruction to use as a word's code-field, which proved to be an "interesting" exercise in debugging.
I think my next steps include (in no particular order):
- Adding flags field to word headers to identify immediate words. This will let me implement : and ; sooner, since ; is an immediate word.
- Adding CONSTANT, VARIABLE, and CVARIABLE as convenience words.
- Implementing EMPTY to reset the state of HERE and the symbol table. This will save me from having to BYE back to TIM/V and re-start Forth from a g command all the time.
- Adding S" for use both interactively and when compiling, so that I can use BLOCK, UPDATE, S", and CMOVE as the most primitive way to self-host software development on the Kestrel-2DX, at least until the CLI editor is done.
Of course, I'll work on a more usable command-line block editor once I'm happy with the interpreter. It won't be a full-screen editor though, for the simple reason that I'm already at 10KB - 11KB of code, which is regrettably larger than I would have liked. (To be fair, 3KB of it is reserved space for word headers.) I rather expect to max-out my 16KB self-imposed limit for DX-Forth code image size. :(
Until next time...
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.