Conversation
mkobetic
commented
Feb 18, 2026
| .word XT_CELL | ||
| .word XT_VALLOT | ||
| .word XT_EXIT | ||
| NONAME RAMHEREPLUSPLUS /* ( x -- ) allocate 1 cell in RAM, store x in it, compile the address into the dictionary */ |
Owner
Author
There was a problem hiding this comment.
I had to pull the XT_COMMA in here, because it needs to happen differently based on the MEMMODE. It would be good to come up with better word name, but it should probably be a NONAME as it is very specialized, internal word now.
mkobetic
commented
Feb 18, 2026
| .word XT_REVEAL | ||
| .word XT_COMPILE | ||
| .word PFA_DODEFER | ||
| .word XT_RAMHEREPLUSPLUS |
Owner
Author
There was a problem hiding this comment.
RAMHEREPLUSPLUS now does the job of those removed words internally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gist of this PR is to disentangle RAM dictionary words from RAM pool, and leave RAM pool purely for FLASH dictionary words. To do that we need to allocate RAM space in the RAM dictionary space when compiling RAM words (variables, values, defers). This means that the mode of allocation when these types of words are compiled needs to change based on MEMMODE.
The heart of the implementation hijacks the RAMPLUSPLUS word, changes its semantics to be MEMMODE dependent and changes all the call sites (variable, value, defer) to use the word in a new way. The pre-existing RAMHERE and RAMPLUS words are removed as unused and hard to use correctly in this new world.
Similarly the semantics of
here,alignandallotare changed to reflect the RAM strategy based on MEMMODE as well.This makes the RAM mode act like standard RAM based Forth (with RAM and dictionary allocated in the same memory space) and FLASH mode act like embedded Forth (with RAM and dictionary allocated in separate spaces).
The tester fix that used vallot explicitly had to reverted back to allot as well, for tests to run correctly.
Second commit changes the search order when switching between RAM and FLASH modes to control word visibility. It essentially hides the
ram-wordlistwhen in FLASH mode. This should help preventing compilation of flash words that depend on RAM words (caveat: if people start messing with wordlists and search orders this might be too constraining, but we can cross that bridge when we get there).It also changes
wordsto show all visible words based on the search order rather than just the forth-wordlist.Outstanding issues