----------------------------------------------------------------------------- ----------------------------------------------------------------------------- 82-RAM.TXT A Programmer's Guide to the TI-82 RAM Version 0.3 Copyright (c) 1999 Mattias Lindqvist & Dines Justesen ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This file lists the functions of the known locations in the system part of the RAM. Suggestion, additions and corrections are very welcome, email me at the address listed below. The latest version of this document can always be found at my home page. Dines Justesen email: c958362@student.dtu.dk www : http://www.student.dtu.dk/~c958362 All the words below which are just called pointers is pointers to places in the used part of the ram. The function of these pointers have not been found. Byte 8000: Last key pressed Byte 8001: Translated scancode of key currently pressed Byte 8002: Same as 8001, but FFh if more than one key is pressed Byte 8003: Countdown until keyrepeat Byte 8004: Bit 2 set = Data valid, Bit 0 Set = no key Byte 8005: Current key pressed (scancode as returned by keyboard handler) Byte 8006: Current key pressed (or last if no key pressed now) Byte 8007: ? Length of current token ? menu token ? Byte 8008: Current contrast level (0..1F) Word 8009: Counter used for APD (MSB in 8009) Byte 800B: Cursor blink counter Byte 800C: Current row of text cursor (0-7) Byte 800D: Current column of text cursor (0-F) Byte 800E: Letter under cursor Byte 800F: Command to get current graphics coloum Byte 8011: Command to get current graphics line ??? 8012? buffer? 8 801E: 8x8 Bitmap of top rigth corner of screen Byte 8026: Busy counter Byte 8027: Busy bitmap 11 8028 OP1 11 8033 OP2 11 803E OP3 11 8049 OP4 11 8054 OP5 11 805F OP6 8 806A 11 8072 Buffer used to store program name (used in editor) Word 807D Pointer to begining of var Word 807F Pointer to end of var Word 8081 (Pointer) bytes from end of var to last byte of user mem Word 8083 Pointer Word 8085 Pointer Word 8087 Pointer to ANS? Word 8089 Pointer to last var accesed? Word 808B Pointer Word 808D Pointer to last program found ? 80 808F Start of text mem Byte 810F secondary row of text cursor (0-7) \ Byte 8110 secondary column of text cursor (0-F) \ Byte 8111 secondary Number of first row in window > Secondary text Byte 8112 secondary IY+12 / info Byte 8113 secondary IY+05 And 10 (insert cursor bit) / Word 8114 Pointer to code : Key press pointer Word 8116 Pointer to code Word 8118 Pointer to code Word 811A Pointer to code Word 811C Pointer to code Word 811E Pointer to code Byte 8120 Rom page for code at (8114) or (811C) or (811E) Byte 8121 Code for which "function" of the calc is used (see table) E 8122 pointers like 8114 (E bytes) \ Used to backup includes ROM page and location byte Byte 81?? Backup of IY+D (placed right after the pointers above / handlers Word 8136 Checksum of mem Word 8143 Error handler stuff Byte 8149 Byte 8161 Used to run code at other pages in rom Byte 8163 Number of current menu Byte 8164 Current sub menu selected Byte 8165 Current item selected Byte 8166 Number of items in current menu Byte 8167 Number of items in current sub menu Byte 8168 Backup IY+D (MENU) Byte 8169 Backup IY+C (MENU) Byte 816A Backup 8549 (MENU) (8549=IY+21) Byte 816B Backup IY+3 (MENU) 9 816C ? 9 8175 ? Byte 81DE Current pos in menu ? 81DF Buffer used for writing name of token Byte 81F2 ? 4 81F4 Buffer used by link rutine at 2697E Word 81F8 Cheksum used by link rutines Word 81FD Length (DE) 11 81FF Var info (OP1) 9 8209 buffer 2 3 8212 used un link input handler Byte 8215 X value for graphics rutines Byte 8216 Y value for graphics rutines Byte 8217 Byte 8219 Last error number Word 821A Pointer to current error handler Word 821C Size of some buffer stuff (used by error handler) Byte 821F 8228 Backup buffer used to store image on display when calc APDs 8528 Table of bitmapped system data. IY usually points here. Byte 8549 ? (IY+21) Byte 854D Number af Y-Var. (used by 2DE8 to select token) 3 854E (1F9C) 3 bytes used as part of token name ? Byte 8553 (init 40) Byte 8554 (init 60) Word 8555 Pointer to a place in the buffer below, used to find end (Pointer in system ram (init value:8557)) 8557 Buffer used to stored lastentry (used when pressing 2nd ENTER) 756 8581 Graph memory byte 85d7 Number of entries in buffer at 8557 ???? byte 85d8 byte 85db word 85F3 size of the list of zoom vars (init 99 = 17d reals) real 85F5 ZXmin real 85FE ZXmax real 8607 ZXscl real 8610 ZYmin real 8619 ZYmax real 8622 ZYscl real 862B ZThetaMin real 8634 ZThetaMax real 863D ZThetaStep real 8646 ZTmin real 864F ZTmax real 8658 ZTstep real 8661 ZnMin real 866A ZnMax real 8673 ZUnStart real 867C ZVnStart real 8685 ZnStart word 868E size of list of statvars (init 9A = 17d reals and a byte) byte 8690 init 0 real 8691 Xmin real 869A Xmax real 86A3 Xscl real 86AC Ymin real 86B5 Ymax real 86BE Yscl real 86C7 Thetamin real 86D0 Thetamax real 86D9 Thetastep real 86E2 TMin real 86EB TMax real 86F4 TStep real 86FD nMin real 8706 nMax real 870F UnStart (init 0.0) real 8718 VnStart (init 0.0) real 8721 nStart real 872A Un-1 real 8733 Vn-1 real 873C XFact (init 4.0) real 8745 YFact (init 4.0) real 874E deltaX real 8757 deltaY real 8760 ? 0.9126 real 8769 ? 31 Word 8772 Pointer Word 8774 Pointer Word 8776 Pointer Word 8778 Pointer Word 877A Pointer Word 877C Pointer 7? 87B5 Information about TblInput 65 87BC TblInput (list max length=7) word 888a size of table data (init 12 = 18d = 2 reals) real 888C TableMin real 8895 deltaTable Byte 88A2 init 1 Byte 88A6 init 1 Byte 88A9 init 1 Byte 88AC init 1 Word 88AE Pointer Word 88B2 Pointer Word 88B4 Pointer (in menu 10 points to buffer of strigns/var infos ) Word 88B6 Pointer 756 88B8 Graphics mememory ? 8BB8 Buffer min 12 bytes 9+ 8BCA -> var info (min 9 bytes) Word 8BD3 Pointer Word 8BD5 Pointer Word 8BD7 Pointer 80 8BDF Secondary text memory For other values look at 15470 Word 8C65 start ??? \ Word 8C67 cursor ??? \ Pointers to input buffer Word 8C69 last pos ??? / Word 8C6B end ??? / Word 8C71 Pointer to last var created ? (yvar?) Word 8C73 Pointer 8C79 Buffer (F bytes) ? Word 8C8D Pointer (some menu structure thingy) Byte 8C8F Number of first row in window Byte 8C90 Number of last row in window Byte 8C91 Cursor row (0..7) Byte 8C92 Cursor coloum (0..F) Byte 8C93 Length of current cursor (4 LSB, Upper bits ?? <>0) Word 8C94 \ Secondary text mem vars ??? Pointer to ASZII string Word 8C96 / Position ? Pointer Word 8C98 / . ? Byte 8C9A Init FF Word 8CF2 Pointer Word 8CF4 Pointer Word 8CF6 Pointer Word 8CFF Pointer ?? Word 8D02 Pointer Word 8D04 Pointer Word 8D06 Pointer to last variable accesed (VAT entry of last var??)? Word 8D08 Pointer to var (last accessed sys var ?) VAT entry Word 8D0A Pointer (init to 8D24) Word 8D0C Pointer (init to 8D24) Pointer last byte of mem used by variables Word 8D0E Pointer to last byte of used mem (init to 8D24) Pointer to last byte of used mem (above three wors a pointers, in increasing order points to locations which has reals,24495) Word 8D10 Pointer to last VAT entry (includes ANS) Maybe pointer to last byte of VAT including temporary data Word 8D12 Pointer to last byte of free mem (init to FE6E) VAT Word 8D14 Bytes used for temp data ? Word 8D16 Bytes used for temp data ? Word 8D18 Pointer to last VAT entry (does not include ANS) Maybe pointer to last byte of VAT not including temporary data (Find var searches between start of VAT and 8d18 for normal var and from 8d18 to 8d10 for temp vars ($)) FE6E Start of VAT TABLE OF BITMAPPED DATA ======================= (IY+00) or (8528): bit 4 set: a key has been released bit 3 set: a key has been pressed bit 3 res: no key pressed bit 2 set: Degree \ angle display mode res: Radian / (IY+01) or (8528): bit 5 bit 4 bit 2 set: Graph screen is displayed res: Graph screen is not displayed (IY+02) or (852A): Bit 0 set: Bit 1 set: graph writes to display and graph mem Bit 2 set: graph is beeing displayed Bit 3 set: do not show graph number |bottom lines of graph screen is invalid ???\ graph num shown/not shown Bit 3 res: show graph number |bottom lines of graph screen is valid ??? / Bit 4 set: graph mode is function bit 5 set: graph mode is polar bit 6 set: graph mode is parametric bit 7 set: graph mode is sequence (IY+03) or (852B): bit 7 set : Value of Y is invalid\ bit 7 res : Value of Y is valid \ Used when shown on graph bit 6 set : Value of X/R is invalid / bit 6 res : Value of X/R is valid / bit 3 bit 2 set : graphcusor on ??? bit 1 bit 0 set: Redraw graph res: Use graph mem (IY+04) or (852C): bit 0 set: draw line \ bit 0 res: draw dots \ graphing mode bit 1 set: Simultaneus draw / bit 1 res: Sequential draw / bit 2 set: Grid on bit 2 res: Grid off bit 3 set: Polar coordinates bit 3 res: Rectangular coordinates bit 4 set: Coordinates on bit 4 res: Coordinates off bit 5 set: Axes off bit 5 res: Axes on bit 6 set: Labels on bit 6 res: Labels off (IY+05) or (852D): bit 4 set: use insert cursor bit 3 set: display white on black bit 3 res: display black on white bit 2 set: text has been scrooled bit 2 res: text has not been scrooled bit 1 set: erase line below small font bit 1 res: do not erase it (IY+08) or (8530): bit 6 \ When recalling sys var the error handler is called if bit 5 and 6 bit 5 / are set and sys var is Un-1 or if bit 5 is set and bit 6 is not and sys var is Vn-1 bit 3 set: key repeat on?? bit 3 res: key repeat off? bit 2 (IY+09) or (8531): bit 0 set: bit 2 set: bit 3 set: Calcalator is running bit 4 set: An ON key interrupt has occured bit 5 bit 6 set: stats valid????????????? (IY+0A) or (8532) or (IY+0B) or (8533): bit 1-0 : 11= Engineering \ 01= Scientific > Exponential display mode 00= Normal / (IY+0C) or (8534): bit 2 set : cursor enabled bit 3 set : cursor is currently on bit 4 set : cursor is locked bit 6 set : not at homescreen ??? (3ae) res : at homescreen ??? (IY+0D) or (8535): bit 6 bit 5 bit 2 set: scroll window bit 2 res: do not scroll bit 1 set: affect text memory bit 1 res: do not affect text memory (IY+0E) or (8536): bit 6 set: use extra digits in math bit 6 res: do not use extra digits (set to 0) bit 7 (IY+0F) or (8537): bit 5 bit 0 (checked in menu if graph mode is seqence) some seq stuff (IY+11) or (8539): bit 5 (used in menu stuff) bit 4 \ plot2 bit 3 / doing expression (IY+12) or (853A): bit 0 set: the busy indicator is turned on bit 1 set: there is valid data in the 8 byte buffer at 801E bit 2 set: run indic only, no apd bit 3 set: 2nd has been pressed bit 3 res: 2nd has not been pressed bit 4 set: ALPHA has been pressed | alpha does not exists bit 4 res: ALPHA has not been pressed | but functions are the same bit 5 : Used in cursor function bit 6 set: locked alpha on | as on ti85. Not like ti83. bit 6 res: not locked ALPHA on | (and the cursor exists) bit 7 set: Alpha has been locked ?? | bit 7 res: Alpha has not been locked ?? | (IY+13) or (853B) bit 4 set: Prompt for independent var? bit 5 set: Prompt dependent var? bit 6 (IY+14) or (853C) bit 7 set: write to graph \ small font ? bit 7 res: do not write to graph / bit 4 set: write to graph mem ? bit 4 res: do not write to graph mem ? bit 2 ? if using split screen is is it currently shown ?????? bit 0 set: split screen ON ?? bit 0 res: split screen OFF ?? (IY+15) or (853D) bit 1 set: (reset when menu is entered) bit 3 set: (8121)=43 \ something to do with error ? bit 4 set: (8121)=4B / Registers --------- The TI82 has 6 buffers in the system memory, used to store floating point numbers and variable information. The buffer are called OPX where X is the number of the reg. Each of the registers is 10 bytes. 8028 OP1 8033 OP2 803E OP3 8049 OP4 8054 OP5 805F OP6 FP Stack -------- The TI82 has a stack used to store floating point values. The stack is placed at the end of the used memory, and grows upwards. Page 0 holds all the needed functions to use this stack. Location -------- The byte at 8121 is used to find out which function of the calculator is currently beeing used. The list below contains the know values. Value: Place: Init function: 40 Homescreen 3968 41 Link 396E 42 Matrix edit 3974 43 List edit 397A 44 Setup stat calc 3980 45 Graph 3986 46 Mode 398C 47 Program editor 3992 48 Program name input 3998 49 Window 399E 4A Y-Var input 39A4 4B Table 39AA 4C Tableset 39B0 4D Check RAM 39B6 4E Delete 39BC 4F ? 39C2 50 ? 39C8 51 Zoom factors 39CE 52 Error 39D4 53 Stat plot 39DA Handlers: Location: -1- -2- -3- -4- -5- -6- ROM loc # details ---------------------------------------------------------- homescreen 411B 4313 4330 4025 4342 4362 8B 40 +menus link 73A7 7602 7602 7602 7370 7629 8A 41 matrx edit 4139 31ac 4688 31b2 40af 4672 8d 42 (size 2) 423b 31ac 4688 31b2 40af 4672 8d 42 (size 2) 4302 31ac 4e2d 31b2 40af 4672 8d 42 (in matrix) 447B 31ac 4d69 31b2 40d0 4672 8d 42 (inputting number) list edit 47a5 31ac 4e2d 31b2 31be 4672 8d 43 (chosing location) 498a 31ac 4e0e 31b2 31be 4672 8d 43 (inputing number) calc setup 6000 5f72 5fe2 622e 5f72 5f72 8d 44 graph 462e 5602 55f3 45ef 28f6 45d8 8c 45 mode 6A58 6764 67C5 6C2A 6764 6764 8d 46 prgm edit 4169 4238 4252 4235 4235 423c 8e 47 prgm name 4013 4238 4245 4235 4235 423B 8E 48 window 6959 6764 6924 6c2a 6764 6c1d 8d 49 (top line) 4665 31ac 4978 31b2 31be 4989 8b 49 (inputing values) 6a58 676a 67c5 6c2a 6764 6c1d 8d 49 (selcting format) y-var 68cb 6a2f 6a32 6a49 6a44 6cfc 8e 4a table 58d0 31ac 4d89 31b2 28f6 4672 8d 4b 5adf 31ac 4d89 31b2 31be 4672 8d 4b (inputing numbers) table set 4665 31ac 4978 31b2 31be 4989 8b 4c (inputing numbers) 6a58 6764 67c5 6c2a 6764 6c1d 8d 4c (selecting indp/dep) mem-chkra 5ec9 31ac 5ebd 5ec5 5ec6 5e92 8d 4d delete 7a39 7a34 7a34 7a34 7a34 7a34 8a 4e ? ? 4f ? 5ec2 5f8c 5f7f 5f90 5f93 5fac 8b 50 zoom fac 4665 31ac 4978 31b2 31be 4989 8b 51 error 72f0 7447 7447 7447 7447 7447 8c 52 plot 6000 5f72 5fe2 622e 5f72 5f72 8d 53