Hi,

What are the best RAM areas for storing data such as registers?

Thanks!
That's a good question, and one that gets asked a lot. I'll assume that you're coding a Doors CS assembly program, so you can use any of the Ion SafeRAM areas, with a few caveats, which are listed here:

http://dcs.cemetech.net/index.php?title=GUI_Memory_Areas
http://dcs.cemetech.net/index.php?title=Interfacing_CALCnet2

If you're using neither the GUI nor CALCnet2.2, the full set are:


Code:
;----> Safe Memory Areas
; saferam1 = 768 bytes (APDRAM, aka AppBackupScreen)
; saferam2 = 531 bytes (statRAM)
; saferam3 = 128 bytes (textMem)
; saferam4 = 66 bytes (OpXs)
; saferam5 = 10 bytes (iMathPtrs)
What about appData? its 256 bytes
aeTIos wrote:
What about appData? its 256 bytes
Where is appData, $8000? I would recommend using that only if you're out of other memory locations, because you need to be sure to bcall(_FillAppBasePageTable) before you let Doors CS regain any control (such as calling library routines or terminating your program).
aha I see. Thanks!
aeTIos wrote:
aha I see. Thanks!
My pleasure, did that answer your questions? IF so, might I inquire as to what this will be for?
Yep, this answered my questions. this is just to know where I can store variables so I dont lose them
aeTIos wrote:
Yep, this answered my questions. this is just to know where I can store variables so I dont lose them
Keep in mind that they'll only stay safe for the duration of your program; nothing can be guaranteed once your program terminates. If you want to save them between different runs of your program, there are different techniques to use, namely either writeback or AppVars.
aeTIos wrote:
Hi,

What are the best RAM areas for storing data such as registers?

Thanks!

Make an appvar, and keep them there.
There are some other chunks of free RAM too, and if you're really out of places, you can always reserve a chunk of your program for storing things in. Won't work with apps, of course.
Deep Thought wrote:
There are some other chunks of free RAM too, and if you're really out of places, you can always reserve a chunk of your program for storing things in. Won't work with apps, of course.
Only if you want to store items between executions. If you're trying to just find scratch space, you should always reserve yourself an AppVar or temporary program instead of trying to use space in your program, for two reasons. First, your program will be artificially larger from having that scratch space reserved inside. Secondly, your program will incorrectly trigger writeback.
How can I make/store/recall data to and from an app var?
calcman wrote:
How can I make/store/recall data to and from an app var?
The basics are to use CreateAppVar to create an appvar, ChkFindSym + DelVar to delete a variable, and ChkFindSym to find and modify an existing appvar. You can find the documentation for all of those in the System Routines documentation from TI that I've previously linked.
I couldn't find anything on that link about the app vars.
Late, but http://www.michaelv.org/programs/calcs/info/saferam_areas.txt has a nice list of system RAM areas that you can use.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement