I still see one problem with creating a table then FORGETting it, is the address for that table is still stored somewhere. So if the word that uses the table for a look-up, and the table is no longer there as it got written over by a new word, it will get incorrect data.
I prefer to use the top of available memory for the dictionary and build tables down. The table never needs to be forgotten. And any word that uses the address for the table is still in effect.
I also use this method for temporary strings as well.
New here, but not to Forth or the 6502s
Re: New here, but not to Forth or the 6502s
I don't think it's the table that's being forgotten -- it's the word that initializes the table.
Caveat: have not yet had my second cup of coffee this morning
-- Jeff
Caveat: have not yet had my second cup of coffee this morning
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: New here, but not to Forth or the 6502s
Correct. Only the word that initializes the table is forgotten. The table, SOMETABLE , is still in the dictionary. Once FILL.TABLE has initialized the table, it is no longer needed.
More words could be defined for a more complex initialization and then forgotten once the table is initialized.
More words could be defined for a more complex initialization and then forgotten once the table is initialized.
Re: New here, but not to Forth or the 6502s
Right!
I misread what was happening.
What you are doing, I do this all the time in assembly. Instead of saving, for example, all the addresses for each screen line of the graphics screen, I use a short routine to create the table and save the addresses.
I keep forgetting one of the perks of Forth is to FORGET the routine once it has done its job and free up that tiny space the routine is taking up.
I misread what was happening.
What you are doing, I do this all the time in assembly. Instead of saving, for example, all the addresses for each screen line of the graphics screen, I use a short routine to create the table and save the addresses.
I keep forgetting one of the perks of Forth is to FORGET the routine once it has done its job and free up that tiny space the routine is taking up.