----------------------------------------------------------------------------- ----------------------------------------------------------------------------- 82-ROM.TXT A Programmer's Guide to TI-82 ROM Calls Version 0.5 Copyright (c) 1999 Mattias Lindqvist & Dines Justesen ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- [Please note: This is a modified version of the original file, with access points from ROM version 19.006.] This file lists routines found in the TI82 ROM. All the adresses are from ROM version 19.0, and some of them will not work with other versions. Not all of the functions listed has been tested in an assembly program. If you do find any errors please mail information on which function your called, what address you used and what it was supposed to do. Suggestion, additions and corrections to this document is very welcome, mail them to the address listed below. The newest version of this document can always be foudn an the home page listed below. Dines Justesen email: c958362@student.dtu.dk www : htt://www.student.dtu.dk/~c958362 All number in this document is in hex, except where denoted by a d. Below is a list of symbols used in the text. Bit x,(Addr+y) Test bit x of byte at Addr+y, and set flags Set x,(Addr+y) Set bit x of the byte at Addr+y Res x,(Addr+y) Reset bit x of the byte at Addr+y (addr) The contents of the memory location addr x -> y When used with a 16 bit register it means that x is a pointer to y. When used with a FP stack element or OP1..OP6 it means that x is stored in y. (quite confusing, storing should be changed to LD). ---- CALL 0000 ---- Startup code -------------------------------------------- Input : none Result : This is the code executed when the calc is first turned on. ---- CALL 0007 ---- Call general interrupt handler -------------------------- Note : the function calls the interrupt handler at 0038 ---- CALL 0008 ---- OP1 -> OP2 ---------------------------------------------- ---- CALL 000B ---- Bit 0,(IY+7) -------------------------------------------- ---- CALL 0010 ---- Search for varialbe by name ----------------------------- Note : Assumes that the var is not a program (or type 6). This function calls 226E, see that for information on how to call this. ---- CALL 0013 ---- Is graph mode function ---------------------------------- Result : Bit 4,(IY+2) ---- CALL 0018 ---- Push value in OP1 on FP stack --------------------------- ---- CALL 001B ---- Do not use graph mem ------------------------------------ Result : Set 0,(IY+3) ---- CALL 0020 ---- (HL) -> OP1 --------------------------------------------- ---- CALL 0023 ---- A = (8BCB) or (8BCB) ------------------------------------ ---- CALL 0028 ---- OP1 = OP1*OP2 ------------------------------------------- ---- CALL 002B ---- A=(8BCB)=0 ---------------------------------------------- ---- CALL 0030 ---- OP1 = OP1+OP2 ------------------------------------------- ---- CALL 0033 ---- LD HL,(HL) ---------------------------------------------- Input: HL -> data word Result: HL = data word A = L ---- CALL 0038 ---- Interrupt handler --------------------------------------- ---- CALL 0081 ---- Has the ON key been pressed ? --------------------------- Result: Bit 4,(IY+09) ---- CALL 0086 ---- Is graph mode polar ------------------------------------- Result: Bit 5,(IY+02) ---- CALL 008B ---- Is graph mode seq --------------------------------------- Result: Bit 7,(IY+02) ---- CALL 0090 ---- Is graph mode param ------------------------------------- Result: Bit 6,(IY+02) ---- CALL 0095 ---- CP HL,DE ------------------------------------------------ Input: DE and HL holds valus to compare. Result: Falgs set. No registers destroyed. ---- CALL 009B ---- Display : ----------------------------------------------- ---- CALL 00A1 ---- Unpack one digit of HL to A ----------------------------- ---- CALL 00B3 ---- Update busy counter ------------------------------------- ---- CALL 0122 ---- APD ----------------------------------------------------- Input: none Result: The calc is turned off is enough time has gone for APD. (used by the interrupt handler to manage APD) ---- CALL 0148 ---- Halt ---------------------------------------------------- Input: none Result: The HALT instruction is executed ---- CALL 014A ---- Reset APD counter---------------------------------------- Input: none Result: (800A)=0074h ---- CALL 0150 ---- Keyboard handler 1 -------------------------------------- Input: nothing Result: All memory locations concerning keypresses are update. This funcion is called by the interrupt handler to update the keybuffer. ---- CALL 0192 ---- More than one key pressed ------------------------------- Input: none Result: (8002)=FFh \ More than one key pressed (8004)=5h / ---- CALL 019D ---- Read key from port -------------------------------------- Input: none Result: A = Key. Carry set if more then one pressed ---- CALL 01D7 ---- Read information from keyboard -------------------------- Input: A = key group mask Result: A = B = key press data ---- CALL 01E6 ---- Store keystroke in buffer ------------------------------- Input: A = Key to store Result: (8000) = Scancode (8006) = Scancode if not zero Set 3,(IY+0) ---- CALL 01F3 ---- Read current keystroke from buffer ---------------------- Input: Nothing Result: A = Scancode of key currently pressed HL = Pointer to buffer Res 3,(IY+000) ---- CALL 0200 ---- Alpha stuff --------------------------------------------- Used to update cursor information ---- CALL 0207 ---- More alpha stuff ---------------------------------------- Used to update cursor information ---- CALL 04B5 ---- Call function at (8116) and (8118) ---------------------- Result: Cals 4C0 and 4C6 and bit stuff. ---- CALL 04C0 ---- Call function at (8116) page (8120) --------------------- Result: The function is called. HL is destroyed. The rom page will be changed to (8120). ---- CALL 04C6 ---- Call function at (8118) page (8120) --------------------- Result: The function is called, and a lot of bit stuff. ---- CALL 0507 ---- Call function at (811A) page (8120) --------------------- Result: The function is called. The functions does not destroy any registers but, HL will be the adr of the function when the function os called. The rom page will be changed to (8120). ---- CALL 050C ---- Call function at (811E) page (8120) --------------------- Result: Bit 5,(IY+4). The function is called. Destroys HL. The rom page is changed to what it was before on return from function. Before the function is called A=B=(8161) ---- CALL 051D ---- Call function at (811C) page (8120) --------------------- Result: The functions is called. Destroys HL and A. The rom page is changed back to what it was before on return from the function. ---- CALL 052F ---- Call function at (8114) page (8120) --------------------- Result: The function is called. The functions does not destroy any registers but, HL will be the adr of the function when the function os called. The rom page will be changed to (8120). ---- CALL 0540 ---- Homescreen error handler -------------------------------- ---- CALL 05DF ---- Turn off calc f1 ---------------------------------------- Input: none Result: The display is turned off, the checksum at 8145 is updated and calc halted. (Used for APD) ---- CALL 0690 ---- Has the ON key been pressed ----------------------------- Result: Set 4,(IY+9) ---- CALL 06CB ---- Reset calc ---------------------------------------------- Input: none Output: The whole calc is reset. ---- CALL 07C0 ---- Init system pointers ------------------------------------ Result: 8D0A, 8D0C, 8D0E are set to 8D24 (beginning of user mem) 8D10, 8D12, 8D18 are set to FE6E (start of vat) 8553 = 40H and 8554 = 60h ---- CALL 07E1 ---- Calc checksum between 8D24 and FE70 --------------------- Result: Checksum memory between 8D24 and FE70 HL = checksum IX = FE71 BC = 0 DE = -HL ---- CALL 0813 ---- Inittialize calculator ---------------------------------- Called from 0000, initializes the calc. ---- CALL 083A ---- Delay for screen ops ------------------------------------ Input: none Result: Nothing (HL incresed and decreased, but flags not alterd) This function should be called after each operation the display controller performs. ---- CALL 1A2C ---- HL=HL*9 ------------------------------------------------- Input: HL holds number Result: HL=9*HL BC=HL ---- CALL 1A36 ---- Get type of OP1 ----------------------------------------- Result : A = (OP1) and 0Fh ---- CALL 1B44 ---- Copy (HL) -> (DE) --------------------------------------- ---- CALL 1BB3 ---- Copy (HL) -> OP1 ---------------------------------------- ---- CALL 1C61 ---- Write BC times 0 to (HL) -------------------------------- Input: Hl holds pointer, BC holds number of bytes Result: BC bytes of 0 is written to (HL) ---- CALL 1C67 ---- Get upper nible ----------------------------------------- Input: C hold value Result: A = upper nible of C ---- CALL 1C6F ---- A=C*4 --------------------------------------------------- Input: C holds value to be multiplied Result: A = 4*C ---- CALL 1ED8 ---- Get constant from table 4 ------------------------------- Input: B holds number of constant to get Result: OP2 holds the constant from the table at 156F. If OP5 is negative then an offset of 8 is used. ---- CALL 1EE0 ---- Get constant from table 3 ------------------------------- Input: B holds number of constant to get Result: OP4 holds the constant from the table at 14EF. If OP5 is negative then an offset of 8 is used. ---- CALL 1EF6 ---- Copy var number c --------------------------------------- Input: HL points to start of table. B=size of vars and C= var number to get De points to place to copy the variable. A= offset from begining. Result: The variable is copied to de ---- CALL 1F04 ---- Get constant from table 2 ------------------------------- Input: A holds number of constant to get Result: Constant number a from the table at FA6 is copied to OP4 (the constants are all 8 bytes) ---- CALL 1F1A ---- Get constant from table --------------------------------- Input: A holds number to get Result: The constant is placed in OP1 The constants are the following: # Value Name -------------------------------- 0: 57.29577951308232 180/Pi 1: 1.570796326794897 Pi/2 2: 0.7853981633974483 Pi/4 3: 0.4342944816032518 Log e 4: 3.141592653589800 Pi 5: 0.01745329251994330 Pi/180 6: 2.302585092994046 ln 10 ---- CALL 1F1F ---- Get constant from table --------------------------------- Input: A holds number to get Result: The constant is placed in OP2 The constants are the following: # Value Name -------------------------------- 0: 57.29577951308232 180/Pi 1: 1.570796326794897 Pi/2 2: 0.7853981633974483 Pi/4 3: 0.4342944816032518 Log e 4: 3.141592653589800 Pi 5: 0.01745329251994330 Pi/180 6: 2.302585092994046 ln 10 ---- CALL 203D ---- Is variable informaiton in OP1 for ANS ??? -------------- ---- CALL 2043 ---- HL=H*L -------------------------------------------------- Input: HL holds number to be multiplied Result: HL=H*L DE=L ---- CALL 2054 ---- Check that OP1 is real (else error) --------------------- ---- CALL 20AF ---- (88AE)=(8D0E) ------------------------------------------- ---- CALL 20F0 ---- Bit 0,(IY+7) ----------------------------------------------- Note: Calls errorhandler if cleared ---- CALL 20F7 ---- Bit 4,(IY+9) -------------------------------------------- Note: Calls errorhandler if the ON key has been pressed ---- CALL 20FE ---- BIT 5,(IY+9) -------------------------------------------- ---- CALL 2103 ---- BIT 1,(IY+3) -------------------------------------------- ---- CALL 2108 ---- Get upper nible of OP1 byte 1 --------------------------- Result: A=(OP1)=4 MSBs ---- CALL 2179 ---- Is (8121) = 40, 4A, 43, 49, 45, 4B or 4C (rets which) --- ---- CALL 218C ---- Is var in OP1 type 5/6 ---------------------------------- ---- CALL 2195 ---- Comapre DE with 003F ------------------------------------ ---- CALL 219C ---- Test (IY+14) bit 0 and 2 -------------------------------- Input: none Result: Returns zero if bit 2 is set or bit 0 is cleared. Otherwise it returns nz. Zero=split screen on. ---- CALL 21A4 ---- BIT 0,(IY+14) ------------------------------------------- ---- CALL 21A9 ---- RES 2,(IY+14) ------------------------------------------- ---- CALL 21AE ---- SET 0,(802A) -------------------------------------------- ---- CALL 21E1 ---- Write 7 to port 10 -------------------------------------- Input: none Result: The value 7 is writen to port 10 ---- CALL 21EB ---- Write 5 to port 10 -------------------------------------- Input: none Result: The value 5 is written to port 10 ---- CALL 21F0 ---- Get # of bytes availble --------------------------------- Input: none Result: HL = number of bytes availble BC = Pointer to end of user mem ---- CALL 2202 ---- Get length of name at (HL) ------------------------------ Input: (HL) holds name as zero terminated string (8 bytes long) Result: A holds length ---- CALL 2205 ---- Get length of name at OP1+1 ----------------------------- Input: OP1+1 or (8029) holds name as zero terminated string (8 bytes long) Result: A holds length ---- CALL 2216 ---- Search for program by name ------------------------------ Searches the program VAT for a program. info in OP1. Result: HL = pointer to VAT entry DE = Pointer to data space ---- CALL 2269 ---- Serach for variable by token/name ----------------------- Seraches VAT to find variable. infor in op1. works for all types. Result: HL = pointer to VAT entry DE = Pointer to data space ---- CALL 226E ---- Search for variable by token ---------------------------- Same as rst 10. Does not work for programs. Info in OP1. Result: HL = pointer to VAT entry DE = Pointer to data space A = (OP1) = type of var ---- CALL 22D0 ---- Create VAT info at (8D12) ------------------------------- Input: OP1 holds data to write to VAT. Result: The values is added to the VAT starting at (8D12). HL = pointer DE = pointer ---- CALL 2329 ---- Allocate memory ----------------------------------------- Input: BC = number of bytes. AF holds something too? Result: the memory is allocated ---- CALL 239D ---- Move memory up ------------------------------------------ Input: De points to the place to insert HL bytes Result: The bytes are inserted, and system pointers are updated ---- CALL 23A7 ---- Move memory up ------------------------------------------ Input: De points to the place to insert HL bytes Result: The bytes are inserted, but system pointers are not updated ---- CALL 23C2 ---- Is memory availble -------------------------------------- Input: HL = Number of bytes to get Result: DE = Number of bytes to get HL = Number of bytes you can have extra Carry clear on succes ---- CALL 23F3 ---- Is memory availble 2 ------------------------------------ Input: HL = Size of variable data OP1 = holds variable information on the var If the variable is a program then A = length of name Result: Carry clear if you can get it set otherwise. Note: This function check that there is room for the data and the vat entry. ---- CALL 2408 ---- Create Variable ----------------------------------------- Same as 22e0 but different parameters ? ---- CALL 240B ---- Create Variable ----------------------------------------- Input: Result: Does evrything ---- CALL 2478 ---- Create Real variable ------------------------------------ Input: only name ? Result: It is created ---- CALL 24B6 ---- Create Variable ----------------------------------------- Also initializes length field of data area ---- CALL 24F5 ---- Reszie Variable ----------------------------------------- Input: HL = current size of variable. DE = new size of variable. (8087) and (8089) -> variable. OP1 holds variable info. Result: The variables size is adjusted to the new size. ---- CALL 2524 ---- Update system pointers 1 -------------------------------- Updates a lot of system pointers ---- CALL 2545 ---- Update system pointers 2 -------------------------------- Updates a lot of system pointers ---- CALL 2676 ---- Update system pointers 3 -------------------------------- Updates a lot of system pointers ---- CALL 27D4 ---- Update (8CF2) ------------------------------------------- BC is added to (8CF2) if (8CF2) is > DE ---- CALL 27DA ---- Get actual size of var in bytes ------------------------- Input: A = type of var (MS nibble has to be 0) BC holds length word of the var Result: DE = actual number of bytes (including the length field) ---- CALL 27DE ---- Get actual size of var in bytes ------------------------- Input: HL points to the variable A = type of var Result: HL = pointer to the var DE = actual number of bytes (including the length field) ---- CALL 2973 ---- Is memory availble -------------------------------------- Input: HL = Number of bytes to get Result: Same as 23C2, but error handler called on error. ---- CALL 297A ---- BC=-BC -------------------------------------------------- Input: Bc holds number Result: BC=HL=-BC A=0 ---- CALL 2A22 ---- Initialize error handler -------------------------------- Input: HL points to error handler Results: error handler is installed ---- CALL 2A48 ---- Pop current error handler ------------------------------- Input: none Result: The current error handler is removed and the previous one is reinstalled ---- CALL 2A58 ---- Compare strings ----------------------------------------- Input: HL and DE points to strings Result: BC holds number of bytes which are the same ---- CALL 2A6B ---- Copy zero terminted string ------------------------------ Input: HL = string to be copied DE = string to copy to Result: the string is copied ---- CALL 2A73 ---- Concatenate zero terminted string ----------------------- Input: HL = string to be concatenated DE = place to write string Result: The string at (HL) is appended to the string at (DE) ---- CALL 2A7A ---- Compare length indexed strings -------------------------- Input: HL and DE points to strings Result: Flags set ---- CALL 2AA0 ---- Find bit in bitstream ----------------------------------- Input: HL = Base addres A = # bit from base adr Result: HL = adres of byte A = mask need to select bit ---- CALL 2F11 ---- Save var info for Y-Var in OP1 -------------------------- Input: (854D) hold the number of the var to get (starting from 1) Result: The functions loads the variable information of the var into OP1. (IY+2) is used to select which var is chosen. The select which var to create your self use one of the functions below. 2EE8 Yt 2EF1 Xt 2F07 Y 2F0C r 2F23 Un/Vn Before calling the function the number of the var to create has to be in (854D). So calling 2EE8 with (854D)=2 will leave the variable information for Yt2 in OP1. ---- CALL 2F2B ---- Selftest ------------------------------------------------ Result: The selftest is run ---- CALL 2FA3 ---- Call rom function --------------------------------------- Uses 2FCA for return. ---- CALL 2FD2 ---- Jump to rom function ------------------------------------ ---- CALL 387D (14CB2) ---- Print char in A with out translation ------------ Input: A holds char to display Result: The char is display at the current position ---- CALL 3907 (152A2) ---- Display char in A using small font -------------- Input: A holds char to display Result: The char is displayed using the small font. ((8215) and (8216) holds the position to write it) ---- CALL 390D (153DC) ---- Print ASCIIZ string at (HL) using small font ---- Input: Hl -> ASCIIZ string Result: The string is displayed using the small font. ((8215) and (8216) holds the position to write it) ---- CALL 3913 (15401) ---- Print B chars from (HL) using small font -------- Input: B holds number of chars to display, HL -> string Result: The first B chars of the string is displayed using the small font. ((8215) and (8216) holds the position to write it) ---- CALL 3955 (155E0) ---- Get pointer to string from token 1 -------------- Input: DE holds token Result: HL points to length indexed string. A holds length of string. ---- CALL 395B/3949 (155E5) ---- Get pointer to string from token 2 --------- Input: DE holds token Result: HL points to length indexed string. ---- CALL 3997 (1588B) ---- Copy name of token followed by =? --------------- Input: OP1 holds token to get name of Result: The buffer at (81DF) holds a ASCIIZ strgin containgin the name of the token followed by =? ---- CALL 399D (158AE) ---- Print list of tokens at 8087 -------------------- Input: none Result: The list of tokens pointed to by (8087) is display on the display. The first word of the list is the number of bytes the tokens take up, after that the tokens in the order in which they should be printed. ---- CALL 39A3 (158DF) ---- Print DONE on end of line ----------------------- Input: none Result: DONE is written at the end of the current line (like whena basic program is finished). ---- CALL 39A9 (158EB) ---- Print name of var with token pointed to by HL --- Input: HL->List of tokens DE->End of list Result: The names of the tokens are printed on the current location on the display. This function stops printing when it reaches the token which start at DE. ---- CALL 3A5D (151A4) ---- Clear LCD --------------------------------------- Input: none Result: The LCD is cleared ---- CALL 39AF (14D94) ---- Display number in HL ---------------------------- Input: HL holds number to print Result: The number is printed at the current possition (right jusified in 5 spaces, leading zeroes not printed). OP1 is destroyed by this rutine. ---- CALL 39B5 (5664C) ---- Print *** FAIL ---------------------------------- Input: Hl points to string (ASCIIZ) to print in front of FAIL Result: The string is printed followed by the words FAIL ---- CALL 39BB (5651B) ---- Test calculator --------------------------------- Input: none Result: Part of the self test is executed and the clac is resat. ---- CALL 39F1 (151E1) ---- Clear text screen ------------------------------- Input: none Result: The LCD is cleared, and if bit 1 of (IY+0D) is set the text mem is set to all spaces. ---- CALL 3A2D (14DB8) ---- Print ASCIIZ string ----------------------------- Input: HL -> null-terminated string (800C) = row (800D) = column set 3, (IY+05): display white on black res 3, (IY+05): display black on white ---- CALL 3A33 (15281) ---- Goto top of text screen ------------------------- Input: none Result: The text cursor is moved to the top of the current text window. ---- CALL 3A6F (15430) ---- Turn off busy indicator ------------------------- ---- CALL 3A87 (6523E) ---- Keyboard handler -------------------------------- ---- CALL 3A93 (15417) ---- Turn on busy indicator -------------------------- ---- CALL 3B29 (177FE) ---- Store display contence in buffer ---------------- Input: none Result: The image currently displayed is copied to the backup buffer at 8228 ---- CALL 3B35 (14D68) ---- Print character with translation ---------------- ---- CALL 3B3B (00038) ---- Filler FF's ------------------------------------- Calls interrupt handler Other Variable functions ------------------------ Create a variable of a specific type. These functions updates ANS ? 24DC Program 24D8 GDB 24D1 Pic 24C7 Y-var 24C2 Y-var length 0 24AE type 4 24A0 Matrix 247E List Register function ----------------- The rutines below copies one register (or parts of it) to another register. 1BBE OP1 -> (DE) 9 bytes 1BB9 (HL) -> OP2 9 bytes 1BB8 (HL) -> OP2 9 bytes (also copies (HL) to OP1) 1BB3 (HL) -> OP1 9 bytes 1BAB OP4 -> OP6 1BA6 OP5 -> OP3 1BA1 OP4 -> OP3 1B99 OP2 -> OP3 1B94 (HL) -> OP3 Digits-e 1B8C OP3 -> OP1 Digits 1B84 OP3 -> OP1 Digits-e 1B7C OP5 -> OP1 Digits-e 1B74 OP3 -> OP2 Digits-e 1B6C OP2 -> OP1 Digits 1B67 OP4 -> OP1 Digits 1B5F OP1 -> OP4 Digits 1B57 OP2 -> OP4 Digits 1B40 (HL) -> (DE) 1B3A OP2 -> OP1 1B32 OP1 -> OP5 1B2A OP1 -> OP6 1B22 OP2 -> OP6 1B1A OP2 -> OP5 1B12 OP3 -> OP5 1B0A OP4 -> OP5 1B05 OP3 -> OP1 1B00 OP5 -> OP1 1AFB OP4 -> OP1 1AF6 OP6 -> OP1 1AEE OP6 -> OP2 1AE6 OP1 -> OP2 1ADE OP5 -> OP4 1AD6 OP5 -> OP6 1ACE OP5 -> OP2 1AC6 OP1 -> OP3 1ABE OP3 -> OP2 1AB5 OP4 -> OP2 1AAC OP2 -> OP4 1AA3 OP1 -> OP4 1A9A OP3 -> OP4 Misc functions using the registers 1A57 Compare OP1,OP2 1A51 Compare |OP1|,|OP2| 1A4C Compare OP1,(HL) 1A44 Compare OP4,OP3 1A27 (DE) = 1.0 1A21 (DE) = 0.0 19E6 A=(8031)=(8032)=(803C)=(803D)=0 (zero out last 2 bytes of OP1 and OP2) The following functions subtracts the value shown below from the 2nd byte of OP1. OP1 is not altered, the value is returned in A. Destroys E. 20E1 081 20E8 07F 20EC 08C 20E3 A (the register) 20D9 OP2 byte 2 The rutines below write 00 XX 00 00 ... to OP1, where XX is the value indicated 2087 52 2083 5B 209C 58 20A0 59 20A4 54 20A6 value in register A The rutines below writes the indicated value to op1 (token) 2071 __2A0100 2091 00216200 Real 208B 03016200 Y-Var 207C 01 A5D00 List number A 206A 03004000 Y-Var 2060 05002300 System program 205B 05002100 System program 204F __2E0100 1 Set register to value 1C41 OP1=0.0 1BEA OP1=1.0 1C02 OP1=2.0 1BF6 OP1=3.0 1BEF OP1=4.0 1C3C OP2=0.0 1C12 OP2=1.0 1C07 OP2=2.0 1BE2 OP2=3.0 1BDB OP2=4.0 1BD4 OP2=5.0 1BCD OP2=8.0 1C37 OP3=0.0 1BC8 OP3=1.0 1BFD OP3=2.0 1C32 OP4=0.0 1BC3 OP4=1.0 1C17 (HL)=A Same as above, but does not change sign byte. 1C47 OP2 = 0.0 The following rutines writes 11 bytes 00. 1C4C OP1 1C51 OP2 1C56 OP3 The functions below shifts the register one digit rigth (div by 10). 1C75 OP2 (does not use extra digit) 1C84 OP2 (does use extra digit) 1C7B OP1 (uses all digits and first digit of exponent) 1C87 (HL) (does use extra digit) The functions below shifts the register one digit left (mul by 10). 1CA1 OP3 (does not use last 2 digits) 1CA6 OP1 (does not use last 2 digits) 1CB3 OP3 (does not use extra digits) 1CB8 OP1 (does not use extra digits) Write value in register to real. type source dest 1CD5 OP2 OP4 OP3 ? 1CDD 1 OP1 OP3 ? 1CE4 b-OP5 OP2 OP3 ? Exchange registers 1E5E OP1 OP2 1E54 OP1 OP3 1E59 OP1 OP4 1E3D OP1 OP5 1E42 OP1 OP6 1E47 OP2 OP4 1E4C OP2 OP5 1E30 OP2 OP6 1E35 OP5 OP6 1E64 (HL) (DE) The following functions subtracts one registers from another, the functions marked with an e uses the exponent too. This is not fp math function, only uses digits. 1E27 OP1 = OP1 - OP1 1E1E OP3 = OP3 - OP1 1E18 OP4 = OP4 - (HL) 1DED (DE)=(DE) - (HL) 1DE7 (DE)=(DE) - (HL) e 1DE1 OP1 = OP1 - OP3 e 1DD9 OP3 = OP3 - OP1 e 1DD4 OP1 = OP1 - OP2 e 1DCC OP2 = OP2 - OP1 e Same as above, but adds. 1DC3 OP1 = OP1 + OP3 1D6C OP1 = OP1 + OP3 e 1D63 OP1 = OP1 + OP2 1D5E OP2 = OP2 + OP2 1D56 OP1 = OP1 + OP2 e 1D4E OP2 = OP2 + OP1 e 1D46 OP2 = OP2 + OP4 e 1DB3 OP2 = OP2 + OP3 uses sign of OP5 only 4 bytes 1DA3 same as above but all digits and exponents Misc 1E70 Is OP1 0.0 1E75 Is OP2 0.0 1EE0 Transcendal function ?? 1FDF Is OP2 positive 1FE5 Is OP1 positive 1FEB OP2=|OP2| 1FF0 OP1=|OP1| 2005 Dec exponent of OP1 200D Inc exponent of OP1 2029 Check exponent of op1 (overflow underflow) 2037 Is exponent of OP1 >0 FP Stack rutines ---------------- The FP Stack is an upwards growing stack which is used for temporary storage of real/complex reals. Std. stack rutines ------------------ 281F POP OP1 281A POP OP2 2815 POP OP3 2810 POP OP4 280B POP OP5 2806 POP OP6 2822 POP (HL) 2869 PUSH OP1 2864 PUSH OP2 285F PUSH OP3 285A PUSH OP4 2855 PUSH OP5 2850 PUSH OP6 FPS(X) Represents real number x on the FP Stack, the element at the top is called number 0. Adr 0 09 12 1B 24 2D 36 3F 6C E # 0 1 2 3 4 5 6 7 12 Put value on stack -------------------- 2922 OP1 -> FPS(1) 2937 OP1 -> FPS(2) 2950 OP1 -> FPS(3) 295F OP1 -> FPS(4) 2969 OP1 -> FPS(5) 2918 OP2 -> FPS(1) 2941 OP2 -> FPS(3) 2913 OP3 -> FPS(1) 2946 OP3 -> FPS(3) 2932 OP5 -> FPS(2) 295A OP5 -> FPS(4) 291D OP6 -> FPS(1) 294B OP6 -> FPS(3) Get value from stack -------------------- 28E1 OP1 <- FPS(1) 28FA OP1 <- FPS(2) 2909 OP1 <- FPS(3) 28B2 OP1 <- FPS(4) 28BC OP1 <- FPS(5) 288A OP1 <- FPS(6) 2894 OP1 <- FPS(7) 2880 OP1 <- FPS(12) 28DC OP2 <- FPS(1) 28F5 OP2 <- FPS(2) 2904 OP2 <- FPS(3) 28AD OP2 <- FPS(4) 289E OP2 <- FPS(5) 28D7 OP3 <- FPS(1) 28F0 OP3 <- FPS(2) 28C1 OP3 <- FPS(3) 28D2 OP4 <- FPS(1) 28C8 OP5 <- FPS(1) 28CD OP6 <- FPS(1) 28A8 OP6 <- FPS(4) Misc rutines for the Fp Stack ----------------------------- 2982 Get pointer to first element (number 0) 2828 Delete mem for a cplx real on the stack (2 reals) 282B Delete mem for a real on the stack 2836 Delete HL reals from the stack 2844 Get mem for HL reals on the stack Error handling -------------- The error handler is located at 29F8, but the ROM also includes a lot of functions which load the regs with the need values and then calls this. Besides that a pointer to the routine placed in the RAM is also used. To use the error handler the information at 821A has to hold the correct data. The function at 2A22 is used to update this data, just call this function with a pointer to the errorhandler in HL. The function will then update the data at 821A. On return from the function the function at 2A48 has to be called if no error occured. If an error occurs and the error handler is called it will use the information at 821A to set memory pointers to their correct value and then return to the caller. Error ADR ------------ 081 298A 082 298E 083 2992 084 2996 085 299A 087 299E Error: Syntax 09C 29A2 088 29A6 09B 29AA 089 29AE 08A 29B2 08B 29B6 08C 29BA 08D 29BE 00D 29C2 (used in programs) 08E 29C6 08F 29CA 090 29CE 091 29D2 092 29D6 086 29DA 014 29DE 015 29E2 098 29E6 099 29EA 09A 29EE 01D 29F2 09E 29F6 FP Math functions ----------------- 0923 CP OP1,OP2 (OP3=OP1 OP4=OP2) 092C OP1 = MIN(OP1,OP2) 0935 OP1 = MAX(OP1,OP2) 093E OP1 = OP1+(HL) (no extra digits) 0943 OP1 = |OP1|+|OP2| (no extra digits) 094B OP1 = INT(OP1) 095C OP1 = OP2-OP1 (no extra digits) 0961 OP1 = IPART(OP1) 096A OP1 = OP1*2 (no extra digits) 096D OP1 = OP1+1 (no extra digits) 0972 OP1 = OP1-1 (no extra digits) 0975 OP1 = OP1-OP2 (no extra digits) 0985/097C OP1 = OP1+OP2 0A22/0A30 Convert OP1 from deg to rad 0A26/0A39 Convert OP1 from rad to deg 0A50 or RST 0028 OP1 = OP1*OP2 (no extra digits) 0A57 OP1 = OP1*OP2 (extra digits) 0A4F OP1 = OP1^2 0A47 OP1 = OP1*0.5 0A42 OP1 = OP1^3 0B89 OP1 = -OP1 0B99 OP2 = -OP2 0BAF OP1 = FPART(OP1) 0BF6/0C00 OP1 = OP1 / OP2 0BFC OP1 = 1/OP1 0CC7/0CCD OP1 = SQRT(OP1) ??? 0E53 OP1 = LN(OP1) 0E57 OP1 = LOG(OP1) 102F OP1 = e^OP1 1039 OP1 = 10^OP1 120B OP1 = SIN(OP1) 120F OP1 = COS(OP1) 1213 OP1 = TAN(OP1) 15F3 OP1 = TANH(OP1)?? 15F7 OP1 = COSH(OP1)?? 15FB OP1 = SINH(OP1)?? 1692 OP1 = ARCCOS(OP1) 1698 OP1 = ARCSIN(OP1) 16A3 OP1 = ARCTAN(OP1) Tabel of data ------------- 056F Data (last byte = 05A3) pointers to routines to init apps starts from 40 0FA6 Table of 8 byte data 2120 Table of token (last byte = 2127) 2185 Table of ? (last byte = 218B) 1F32 Table of constants The constants are the following: # Value Name -------------------------------- 0: 57.29577951308232 180/Pi 1: 1.570796326794897 Pi/2 2: 0.7853981633974483 Pi/4 3: 0.4342944816032518 Log e 4: 3.141592653589800 Pi 5: 0.01745329251994330 Pi/180 6: 2.302585092994046 ln 10 (AND MAYBE A FEW MORE) 14EF Data (table to calc transcendal functions) 156F Data (table to calc transcendal functions) 2ABB Data used to find pixel (8 bytes) 19F4 Real 0.50 19FD Real 0.25 1A06 Real 0.75 1A0F Real 0.00 1A19 Real 1.00 Untested Rom functions: ----------------------- Page 0: ---- CALL 3B2F (16715) ---- Update cursor ??? ------------------------------- ---- CALL 3A09 (177E9) ---- Update diplay from backup buffer ---------------- ---- CALL 39F1 (151E1) ---- Clear text screen (might affect text mem) ------- ---- CALL 39CD (15193) ---- Clear full LCD (does not check split screen) ---- ---- CALL 3991 (15877) ---- Write value at (HL) A times to (DE) (or untill (81DE)=10) ---- CALL 394F (155A0) ---- Update top rigth corner of screen from buffer at 801E ---- CALL 3943 (1554F) ---- Update current line from buffer at 8C79 --------- ---- CALL 393D (1552C) ---- Update current line from text mem --------------- ---- CALL 3937 (1551D) ---- Update line (810F) from text mem? --------------- ---- CALL 391F/3925 (15485) ---- Copy info to secondary --------------------- ---- CALL 3919 (15470) ---- Copy text stuff to secondary -------------------- ---- CALL 3901 (1528C) ---- Get pointer to current char --------------------- ---- CALL 38FB/3A51 (15262) ---- Write spaces to reset for screen (returns to current pos)? ---- CALL 38F5 (1523F) ---- Clear to end of line (does not affect cursor) --- ---- CALL 3A45 (151F7) ---- Clear text window ------------------------------- ---- CALL 38EF (151E9) ---- Clear text screen (full)(do not use iy+x) ------- ---- CALL 38E9 (151DC) ---- Clear full lcd and text screen ------------------ ---- CALL 38E3 (15113) ---- Scroll one line up ? ---------------------------- ---- CALL 38DD (150E0) ---- Move cursor one line up ------------------------- ---- CALL 38D1/38D7 (150CC) ---- Scroll display B lines --------------------- ---- CALL 38CB (1508E) ---- Scroll display one line (iy+x used) (display+textmem)* ---- CALL 38C5 (15080) ---- Move cursor to next line (might scroll) --------- ---- CALL 38BF (15004) ---- Goto next line (might scroll uses iy+x) --------- ---- CALL 38B9 (14FFA) ---- Is it the last line ? --------------------------- ---- CALL 3883 (14DF2) ---- Print length indexed string --------------------- ---- CALL 3877 (14C84) ---- Get current byte from display (and set cursor to line in 8011) (returned in A) ---- 39C1 (56568) ---- Display test (used as part of selftest) -------------- ---- 39D3 (475B5) ---- (811C)=28F6 ------------------------------------------ ---- 39DF (45AF9) ---- Display graphics mem (can use split screen, does not check if it is ok) [Warning: The pages 1-7 of the new system ROM are currently unknown!! The addresses marked with a `!' are for ROM version 19.0 only.] Page 1: !5871 A = A*8+80H !55C8 A = A*16 !558A Goto end of line 0 !6602 Fill screen with pattern in DE !662A Fill screen with pattern in A and wait for key (does not return if onkey pressed) !57D2 Scroll text screen one line up !584A Delete line in a (line number in a 80 for first) !4DD1 Print length indexed string with translation of last col !5185 BC=16*# of lines in window (IX has to point to 800C) !55CD HL = (B+1)*60H(get pixel number from y-cord) !54A0 copy from second pointers !558A Goto top rigth cornoer of screen !53EF Print b chars from (hl) to display using small font Page 4: !4166 Find Pixel ! B = X cord C = line returns A = bit mask HL = Offset of byte 800F = Byte command 8011 = Line command !6AB5 Goto start of bottom text line in window (graph cursor) !6CB0 Write space in small font !6BD3 Write labels on axes Misc other functions -------------------- !2EA3 Display string from token in E !2EAF Search for variable by name and return pointer to end in hl and pointer to start in de (same params as rst 10) !2F1B Goto line a and write : Indpnt: (newline) Depend: !2F4B Read current key stroke (as 1d4), but it also returns value as fp number in OP2 (must be like ti-basic getkey) !3911 Copy real 12345.0 and real 67890.0 to buffer at 8BB8 LINK RUTINES !RECEIVE BYTE : 26ACB !SEND BYTE : 269AD CALC ON/OFF 3A0F DISPLAY ON 831 POWER OFF DISPLAY PORT10=2 DISPLAY OFF CALL 03745H ; 46B7 Resize var in DE to max size (call2 41ee) CALL 03343H ; 5EAB Resize var in DE to max size and init as buffer(call 646c8) !36842 Get pointer to system var in A (returns pointer to data in HL and DE (-> info for lists) a holds type) 327D 268C7 ? list ? 3A15 368DC Store value in OP1 to ANS 30B5 368E2 Store value in OP1 to theta 30BB 368E8 Store value in OP1 to r 30C1 368EE Store value in OP1 to y 365B 368F4 Store OP1 to 62 21 = table step ? (create if necesarry) 30C7 3690A Store value in OP1 to T 30CD 36910 Store value in OP1 to x 3727 36914 Store value on FPS(1) to var in OP1 (STOOTHER)