6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 1:33 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Thu Aug 20, 2020 12:09 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 20, 2020 1:07 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
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

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 20, 2020 8:48 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
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.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 21, 2020 5:18 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: