Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: thepenguin77 on June 12, 2012, 11:47:39 pm

Title: 83+/84+ Free Ram Areas
Post by: thepenguin77 on June 12, 2012, 11:47:39 pm
Hey everybody, Sorunome (https://www.omnimaga.org/profile/Sorunome) here. I converted this table into a more machine-readable format and made it way easier to search by address or by ID, so e.g. when searching for 8005 (or $8005 or 0x8005) it'll jump to appData.
You can find it here: https://www.omnimaga.org/index.php?page=ram (https://www.omnimaga.org/index.php?page=ram)
here (https://www.omnimaga.org/asm-language/8384-free-ram-areas/msg404735/#msg404735) is some more information as to what all that search supports

Spoiler For Old Post:

persst collat addr   name             size      what destroys it                how you should fix it        what it breaks

                                                                             
*****  *****  8000   appData          256   v   APD (OFFSCRPT)                  -----
***    *****  8100   ramCode          119   |   flash activities                -----
*****  *****  8177   smallEditCol     185   |   ----                            -----
*****  ****   8230   baseAppBrTab      33   |   ----                            bcall(_fillBasePageTable)    multipage apps on 83+
*****  *****  8251   bootTemp           8   |   receiving OS                    -----
*****  *****  8259   MD5Stuff          74   |   MD5 calculations                -----
****   *****  82A3   appSearchPage      2   |   OS general app routines         -----
****   *****  82A5   tempSwapArea L4  232   |   archive stuff                   -----
****   *****  838D   appID              5   |   OS general app routines         -----
****   *****  8392   arcPageStuff       3   |   most archive operations         -----
****   *****  8395                     16   |   ???                             -----
*      *****  83A5   MD5Buffer         12   |   Axe-subroutine arguments        -----
**     *****  83B1   MD5Buffer         30   |   Axe-Archived variable pointers  ----- 
**     ***    83CF   MD5Buffer          2   |   Axe-random seed                 -----
***    *****  83D1   MD5Buffer          8   |   Axe-sprite rotation/flipping and hex printing -----
****   *****  83D9   MD5Buffer         12   |   Axe-axiom variables             -----
*****  *****  83E5                      6   |   ???                             -----
***    *****  83EB   Abackup            1   |   flash operations, app bcalls, and other? -----
****   *****  83EC                      2   |   ???                             -----
****   *****  83EE   arcInfo           68   |   link routines and other?        -----
****   *****  8432   appInfo           13   ^   OS general app routines         -----
              843F                         1087

****   *****  8452   prevDData          8   V   ???                             zero
*      *****  845A   lFont_record       8   |   large font                      -----
*      *****  8462   sFont_record       8   |   small font                      -----
****   ****   846A   tokVarPtr          4   |   ???                             zero
****   *****  846E   indicMem          10   |   run indicator                   -----
*      *****  8478   OP1               11   |   Axe-AppVars, float{}, Ans, Text >Dec -----
**     *****  8483   OP2               11   |   Axe-float{}, Ans, Text >Dec     -----
***    *****  848E   OP3               11   |   Text > Tok                      -----
***    *****  8499   OP4-OP6           38   |   random OS routines              -----
****   *****  84BF   progToEdit         8   |   running apps, editing progs     -----
****   *****  84C7   nameBuff          11   |   typing a name                   -----
****   *****  84D2   equ_edit_save      1   |   ??? opening an editor?          -----
****   *****  84D3   iMathPtrs         10   |   editing anything                -----
****   *****  84DD   stuff             14   |   ??? probably editing?           zero
**     *****  84EB   asm_pointers       8   |   moving user memory              -----
*****  *****  84F3   asm_ram           21   |   -----                           -----
****   ****   8508   textShadow L5    128   |   -----                           bcall(_clrTxtShd)
****   ****   8588   textShadPtrs       5   |   -----                           bcall(_clrTxtShd)
****   **     858D   cxVectors         25   |   -----                           manual restore                 changing apps (quitting)
****   *****  85A6                      4   |   -----                           -----           
****   *****  85AA   monQueue          18   |   ???                             -----
***    ***    85BC   onSP               2   |   -----                           manual restore                 homescreen errors
****   *****  85BE   promptStuff       18   |   ???                             -----
****   *****  85D0   varType           12   |   -----                           -----
****   ***    85DC   menuStuff          7   |   -----                           zero
****   ***    85E3   menuFlagBackups    4   |   -----                           zero
****   *****  85E7   progCurrent      120   |   -----                           -----
*****  *****  865F   linkStuff        120   |   linking                         -----
*      ****   86D7   penCol             2   |   small font, OS drawing          zero works
****   ****   86D9   rclQueuePtrs       4   |   -----                           -----
***    ***    86DD   errNo              1   |   OS errors (like appvar stuff)   zero
***    ***    86DE   errSP              2   |   OS errors                       manual restore
***    ***    86E0   errOffset          2   |   OS errors                       zero
*****  *****  86E2                     10   |                                   -----
*****  *****  86EC   saveSScreen L1   714   |   APD                             -----
**     *****  89B6   saveSScreen L1    54   ^   Axe-A-Theta                     -----
              89EC                         1434
                                                                                                     
*****  *****  8A36                      4   V   -----                           -----
*****  *****  8A3A   statVars L2      531   |   -----                           bcall(_delRes)
*****  *****  8C4D   infVars          202   |   -----                           zero
*****  ***    8D17   curGStyle          1   |   -----                           zero
*****  ****   8D18   curGY            137   |   -----                           zero
*****  **     8DA1   graphStuff         6   |   -----                           manual backup                  graphing
*****  ****   8DA7   entryStackStuff  133   |   -----                           manual backup                  entry stack (2nd entry)
*****  *****  8E2C                     59   |   ???                             -----
*****  ****   8E67   graphVariables   494   |   -----                           bcall(_grReset)                graphing variables
*****  ****   9055   financeVariables 126   |   -----                           bcall(_zeroFinanceVars)        finance variables
*****  *****  90D3   smallEditRam     108   |   -----                           -----
*****  ****   913F   moreGraphVars    157   |   -----                           bcall(_grReset)                graphing variables
*****  ****   91DC   tableStuff       294   |   -----                           zero
*****  ****   9302   entryStackStuff    5   |   -----                           manual restore                 entry stack (2nd entry)
*****  *****  9307                     57   |   BASIC menus                     -----
**     *****  9340   plotSScreen L6   768   |   most screen activities          -----
*****  ****   9640   randomSeeds       18   |   -----                           bcall(_randInit)
*****  ****   9652   parsingPtrs       28   |   -----                           manual restore                  quittting
*****  ***    966E   cmdShadow        128   |   -----                           bcall(_clrTxtShd) then bcall(_saveCmdShadow)   MirageOS
                                                                                LnReg and manual restore for MirageOS
*****  ****   96EE   cmdShadowPtrs      6   |   -----                           bcall(_clrTxtShd) then bcall(_saveSmdShadow)
****   *****  96F4   editPtrs           8   |   opening edit buffer             -----                                                               
*****  ****   96FC   listEditPtrs     121   |   -----                           zero 
*****  ****   9775   graphTypes        48   |   -----                           zero
*****  *      97A5   windowStuff       11   |   -----                           manual restore                 small and large text
****   *****  97B0   formatStuff       92   |   displaying OS formatted strings -----
*****  *****  980C   equationStuff      9   |   ??? evaluating an equation?     zero
****   ****   9815                     11   |   ??? deleting stuff?             zero
**     *      9820   stackPointers     20   |   user mem operations             manual restore                 don't touch user mem (appvars)
****   *****  9834   pagedStuff         8   |   archive reading                 -----
****   *****  983C                     43   |   menus                           zero
****   *****  9867   flashTemp          9   |   reading flash                   -----
****   *****  9870   appRawKeyHandle    2   |   ???                             -----
*****  *****  9872   appBakUpScrn L3  768   ^   -----                           -----
              9B72                         4412                                                                       
                                                                                                           
*****  ****   9C06   baseAppBrTab2    106   V   usb stuff                       bcall(_fillBasePageTable)      multi page apps on 83+SE
*****  ****   9C70   usbStuff          62   |   usb stuff                       -----                                         
***    *****  9CAE   SESpeed            1   |   this might get randomly written to -----
*****  *****  9CAF                    182   |   ???                             -----
****   *****  9D65   localTokStr       17   |   used by localization apps       -----
****   *****  9D76   keyToStr          18   |   ???                             -----
*****  *****  9D88   sEdMonSp           2   |   small edit SP                   -----
*****  *****  9D8A   bpSave            11   ^   usb stuff                       -----
              9D95                         399
Persistence:
*****  barring obscure situations, this memory won't be touched by outside forces
****   some avoidable practices will overwrite this memory
***    normal operation may occasionally overwrite this memory
**     this memory location is not stable by any means, though, it's still memory
*      this is hardly memory, it's only listed because it was in the way

Collateral damage:
*****  changing this memory has absolutely no effect on anything
****   there are some situations where changing this has an effect, though, you probably won't run into them
***    this makes some rather rare events fail, but it could happen
**     this makes some common tasks fail
*      honestly, the calculator basically crashed


bcalls:
bcall(_clrTxtShd)          Asm(EF4C45)         
bcall(_delRes)             Asm(EF204A)
bcall(_fillBasePageTable)  Asm(EF1150)
bcall(_grReset)            Asm(EF3148)
bcall(_randInit)           Asm(EF7F4B)
bcall(_saveCmdShadow)      Asm(EF7345)
bcall(_zeroFinanceVars)    Asm(EF2B51)
[/size]
[/font]
[/td][/tr]
[tr][td](http://img.removedfromgame.com/imgs/screen_span2.png)[/td][/tr]
[/table]


The collateral damage number is only correct if you follow my recommendations for cleanup. If you don't, then things might go very bad. What it breaks is what won't work when you are using that memory, it will work after you are done.


And when you clean up, I recommend you first zero all the memory you used, copy back the manual backup locations, and then run all the necessary bcalls.

Lastly, if you see any changes that need to be made to the list (like anything), be sure to tell me.

Be sure to thank shmibs for hacking the width of this page.
Title: Re: 83+/84+ Free Ram Areas
Post by: Runer112 on June 13, 2012, 01:38:26 am
This is a pretty awesome list. Already bookmarked your post. :D

I have two questions:

Then, suggestions:


Other than these nitpickings of mine, awesome.
Title: Re: 83+/84+ Free Ram Areas
Post by: aeTIos on June 13, 2012, 03:46:33 am
Wow, great list. This should definitely be stickied (or is it already?)
Title: Re: 83+/84+ Free Ram Areas
Post by: kindermoumoute on June 13, 2012, 05:26:47 am
Thaaanks !

EDIT : can I use it in my Axe tutorial ?
Title: Re: 83+/84+ Free Ram Areas
Post by: shmibs on June 13, 2012, 09:49:08 am
axe vars are stored in SaveSScreen, not appBackUpScreen.
the does look rather useful. =D
Title: Re: 83+/84+ Free Ram Areas
Post by: thepenguin77 on June 13, 2012, 01:12:33 pm
EDIT : can I use it in my Axe tutorial ?

Sure, though, you might want to wait a few days so that all of the errors have been fixed.

Title: Re: 83+/84+ Free Ram Areas
Post by: aeTIos on June 13, 2012, 01:23:16 pm
Um, since you updated the font the table is broken on small screens. (read: my screen)
Title: Re: 83+/84+ Free Ram Areas
Post by: FloppusMaximus on June 13, 2012, 03:31:24 pm
Runer112: cmdShadow is used for MirageOS internal storage.  If you overwrite that area, it will break both the MirageOS GUI and some of the MirageOS library routines.  The same is true of some parts of statVars, I don't remember which exactly.  And you can expect the same is true of other shells.

The other thing about cmdShadow is that it is used for Ion's program loader (and, of course, the Ion libraries) so you absolutely must not overwrite that area in an Ion program.

Also, thepenguin77, you didn't mention that appData can be overwritten when APD occurs.
Title: Re: 83+/84+ Free Ram Areas
Post by: TIfanx1999 on June 13, 2012, 03:57:28 pm
Moved and stickied. :)
Title: Re: 83+/84+ Free Ram Areas
Post by: aeTIos on June 13, 2012, 06:53:32 pm
Umm, I think this is not only ASM. This was also intended for use with Axe.
Title: Re: 83+/84+ Free Ram Areas
Post by: Runer112 on August 18, 2013, 11:45:27 pm
I found out that parsingPtrs is not safe the hard way. It took me a good hour or so to debug that overwriting basic_start, nextParseByte, and possibly basic_end causes errors to be thrown when the program exits, despite the program not being a BASIC program.
Title: Re: 83+/84+ Free Ram Areas
Post by: ZippyDee on January 05, 2014, 06:33:17 pm
Just for clarification, are the large spans of unlabeled RAM such as at $843F or $89EC all untouchable? Or just unknown?
Title: Re: 83+/84+ Free Ram Areas
Post by: thepenguin77 on January 05, 2014, 08:18:03 pm
If it's not labelled, it probably has a 1 star in both categories. Don't even try to mess with those areas unless you are going to restore them afterwards and aren't going to use any bcalls.
Title: Re: 83+/84+ Free Ram Areas
Post by: Xeda112358 on January 10, 2014, 09:34:28 am
Just for clarification, are the large spans of unlabeled RAM such as at $843F or $89EC all untouchable? Or just unknown?
I believe 843Fh is where the OS interrupt handles key presses and such. If I remember correctly, 843Fh holds the current key press, 8445h holds the last registered key press, and the other in between are counters. Specifically, 8442h is used for repeating keys, starting with a value of 50, counting down to zero. If it reaches 0 and it is a repeating key (arrows or [del]) it repeats the key press, and resets the counter to 10. This is why the initial delay is longer after pressing arrows and such. I read these RAM areas because it is much faster than a silly bcall :P You do need interrupts enabled, though.

EDIT: Actually, rereading your post, ZippyDee, I think you read the values like "1087" and "1434" as the size of the gap. instead, if you subtract 8000h from the address and convert to decimal, you will see these are just the offset into RAM :P
Title: Re: 83+/84+ Free Ram Areas
Post by: c4ooo on March 07, 2015, 04:21:46 pm
What exactly are "lFont_record" and "sFont_record"?
Title: Re: 83+/84+ Free Ram Areas
Post by: Runer112 on March 08, 2015, 01:09:20 pm
Those are the RAM locations to which the OS copies large and small font character bitmaps, respectively, in preparation for them to be drawn.
Title: Re: 83+/84+ Free Ram Areas
Post by: Sorunome on August 25, 2016, 12:02:19 pm
Bcalls seem to change $83EB on the 84+ calculator, however changing it doesn't do anything bad.

Should we maybe make this table some seperate page or somethinga nd keep it up-to-date with new information?
Title: Re: 83+/84+ Free Ram Areas
Post by: Runer112 on August 25, 2016, 12:42:38 pm
It seems that only happens for app bcalls (an app calling to its other pages), but I've added the information to the table in the first post.
Title: Re: 83+/84+ Free Ram Areas
Post by: Sorunome on August 25, 2016, 03:42:21 pm
So I took this table and parsed it with regex into some php-usable data. You can see the result here: https://www.omnimaga.org/index.php?page=ram
it's not only finally looking like an actual table, but at the top box you can just enter any address or label and you'll jump to it.

Entering address as HEX:
 - just typing hex
 - or prefix with $
 - or prefix with 0x

Entering address as BIN:
 - prefix with %
 - or prefix with 0b

Everything else will be treated as a label, the first match will be used (case-insensitive). (e.g. "edit" will jump to smallEditCol ($8177))

If that exact address isn't present it'll jump to whatever row contains it
Title: Re: 83+/84+ Free Ram Areas
Post by: Eeems on August 25, 2016, 04:43:43 pm
You should add that to the tools menu :)
Title: Re: 83+/84+ Free Ram Areas
Post by: Sorunome on August 25, 2016, 04:47:27 pm
You should add that to the tools menu :)
Done!