How to add a "core word" (aka "kernel word") to herkforth
- 1) Edit block 40 and increment num-core-words
- 2) Define your word in block 50 or 52 (see load-core-words).
- 3) export
- 4) Edit blocks/dictionary and move the entry for your new word so it is just after the other core words (which are at the top)
- 5) Define your word in asm somewhere in kernel.s and add another call to the dict_entry macro with the others. To get the hex number, count the number of entries in blocks/dictionary above yours, and multiply this by 32.
Notes
I have become frustrated with several forths (gforth comes to mind) because I haven't been able to find out how to add a core word. This is my attempt not to be like those :) Hope it worked. -- Jason Woofenden