home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / text / misc / ti-bugs.doc < prev    next >
Encoding:
Text File  |  2001-07-01  |  20.8 KB  |  519 lines

  1.    TI-85 and TI-92 tips, tricks, bugs, and undocumented features
  2.              by David Ellsworth (davidells@aol.com)
  3.                          Created: 1996.02.20
  4.                    Last Modified: 1996.05.06
  5.                    Daily Version: 1
  6.  
  7.  
  8. This file can be downloaded from:
  9. ftp://users.aol.com/davidells/TI-Calc/TI_bugs_etc.zip
  10.  
  11. Even though the version of this file is indicated by a date, I may
  12. update it more than once in one day. If I do, the daily version
  13. number will have a value other than one. The following day, it will
  14. be set back to 1.
  15.  
  16. I have had a TI-85 for a long time and got a TI-92 at December 25,
  17. 1995. I am the type of person to test all aspects of a system
  18. thoroughly, so I have found many bugs and undocumented features in
  19. these calculators. I have listed my finds in this document. I realize
  20. that some of this has already been documented elsewhere, but I want
  21. it to all be listed in one place. The TI-92 information is based on
  22. ROM version 1.3.
  23.  
  24. This file does not include any in-depth technical info about the
  25. internals TI-85 and TI-92. For the TI-85, comprehensive information
  26. is already available for ZShell programmers. For the TI-92,
  27. information will soon be available; I am working on a machine
  28. language shell for the TI-92 with two other people. When this is
  29. released, we will also release a set of text files on its internals.
  30.  
  31. ---------------------------------------------------------------------
  32.  
  33. There is a very interesting bug in the TI-85. It exists in all ROM
  34. versions. I found it while I was waiting for TI-Graph Link to arrive
  35. in the mail after I had ordered it; I was planning to use the link to
  36. corrupt memory in various and sundry ways.
  37.  
  38. But I was impatient, and wanted to find a bug I could use to do 
  39. this. Amazingly, I did. I used it to figure out and collect all the 
  40. ASCII codes of the TI-85. BTW, when I was doing this I knew nothing 
  41. about ZShell or anything else that other people have found about
  42. the TI-85. Anyway, I collected all the unaccessable ASCII characters 
  43. and transferred them to another TI-85, then reset mine and 
  44. transferred them back. This, needless to say, took a long time, and 
  45. would have been much easier using TI-Graph Link, but what can I say?
  46. I was impatient and persistant. At the time, I was fascinated that
  47. the TI-85, a calculator, uses standard ASCII from 32 to 126.
  48.  
  49. Here are instructions for activating the bug. First, make sure you 
  50. have a backup of your TI-85's memory; then reset ALL (optional). Go
  51. into the solver and type " " (a single space) for the equation and
  52. press [ENTER]. This will crosslink the custom menu with the xStat
  53. variable. Go into [CATALOG] and put something in the third position. 
  54. Then edit xStat. You will see lots of hexidecimal numbers. You can 
  55. get the TI-85 to do all sorts of weird things at this point.
  56.  
  57. Here is a list of keys that will do the job: (reset all first)
  58.  
  59. [2nd] [GRAPH] [ALPHA] [(-)] [ENTER] [2nd] [CUSTOM] [F3] [F3] [2nd] 
  60. [EXIT] [2nd] [-] [F4] [F1] [ENTER] [down] [down] [down] [EXIT] [2nd] 
  61. [-] [F4] [F1] [ENTER] [F1]
  62.  
  63. Sit back and watch the show. Press [ON] when you have seen enough.
  64.  
  65. ---------------------------------------------------------------------
  66.  
  67. On the TI-85, there is a bug that allows the NUL character (ASCII 0)
  68. to be created without a link cable. Just use the following script:
  69.  
  70.  A=<ch>
  71.  Eq>St(A,A)
  72.  sub(A,2,1)->A
  73.  
  74. Replace <ch> with one of the following characters:
  75.  
  76.  The "10" character from 10^
  77.  The superscript "x" from xth root
  78.  The ">" character from unit conversions
  79.  The "E" character (the [EE] key)
  80.  One of the "?", "#", "&", "'", "@", "$", "~", or "|" characters
  81.  The upside-down "?" or "!" characters
  82.  Any other character that does not have a token associated with it
  83.   and cannot exist in a variable name
  84.  
  85. After running that script, the variable "A" will be a one-character
  86. string containing the NUL character.
  87.  
  88. If you convert "A" to equation with St>Eq, then convert it back to a
  89. string with Eq>St, even stranger things will happen. Here is a script
  90. to create a 51979 byte string that takes up no memory:
  91.  
  92.  A=<ch>
  93.  Eq>St(A,A)
  94.  sub(A,2,1)->A
  95.  St>Eq(A,A)
  96.  ""->B
  97.  Eq>St(A,A)
  98.  
  99. When the last line is executed, the memory following the "A" variable
  100. is overwritten with garbage. The "B" variable follows "A" in memory,
  101. so one of the effects of this is that the size of "B" is modified. A
  102. more detailed explanation of what happens is beyond the scope of this
  103. file.
  104.  
  105. ---------------------------------------------------------------------
  106.  
  107. When I received TI-Graph Link in the mail, I almost immediately
  108. started sending backups, modifying them, and sending them back. I
  109. eventually found out that weird things could be done from the custom
  110. menu. Even later, I found that in fact machine language could be
  111. executed, and spent a long time mapping out all the opcodes by trial
  112. and error. I did not know that the TI-85 had a Z80, but after
  113. mapping out most of the unprefixed opcodes, I had that idea. I
  114. checked out the Z80 text files, and -- lo and behold -- it did have
  115. a Z80 processor! I was flabbergasted, half-upset, and half-overjoyed
  116. that I had spent/wasted all that time mapping out the opcodes. I
  117. wrote some very simple programs, figured out some of the I/O ports,
  118. and made a ROM dump. But I only recently found out that other people
  119. have done this sort of thing with the TI-85, and that there was a
  120. program called ZShell. I was incredibly thrilled when I found this on
  121. the Internet.
  122.  
  123. ---------------------------------------------------------------------
  124.  
  125. The TI-92 has 32 contrast levels, just like the TI-85. It just 
  126. doesn't display the contrast level. When memory is reset or a
  127. backup is restored, the contrast is set to 17/31. There are also
  128. other times that the contrast will be set to an absolute value.
  129.  
  130. ---------------------------------------------------------------------
  131.  
  132. Taking a battery out while the TI-92 is on will not reset it, as
  133. long as it is waiting for input (not doing calculations). It will 
  134. just turn itself off. When you put the battery back in, the TI-92 
  135. will turn itself back on and be in the same state it was before.
  136.  
  137. ---------------------------------------------------------------------
  138.  
  139. Sometimes the TI-92 will crash unexpectedly. I have had no luck in 
  140. predicting this or figuring out a script to generate it (except for 
  141. one that I will reveal shortly, which uses the self test). When it
  142. does crash, here are some of the messages it gives:
  143.  
  144. The following errors are displayed at the top center of the screen 
  145. in the medium-sized font. Behind the error is a black bar covering 
  146. the top line (8 vertical pixels):
  147.   "Illegal Instruction"
  148.   "Address Error"
  149.   "Line 1111 Emulation"
  150.  
  151. Sometimes, the TI-92 will instead display
  152.   "SYSTEM DEAD, CORRUPT SUPERVISOR STACK"
  153. on the bottom of the screen in the small font.
  154.  
  155. ---------------------------------------------------------------------
  156.  
  157. Here are some notes on the TI-85 and TI-92 self-tests.
  158.  
  159. On the TI-85:
  160. [2nd] [MODE] [ALPHA] [S]
  161. The TI-85 will ask "Enter self test?" and give you the ROM version. 
  162. Pressing [ENTER] will erase memory and enter the self test. Any 
  163. other key will exit. Once you are in the self test, it will count 
  164. from 0 forever. It is testing various aspects of the TI-85, such as 
  165. ROM and RAM. Press [ON] to interrupt it. On earlier ROM versions, 
  166. you must adjust the contrast at this point. You will see 5 different 
  167. LCD te st patterns, and then all 32 contrast levels will be tested. 
  168. Press any key to cycle through all this, or press [ON] to skip to 
  169. the next step. You will see "11". Press all the keys in sequence 
  170. according to the codes returned by getky (page 16-13 in the ma 
  171. nual). After you're done, it will display "OK". Press any key, and 
  172. memory will be reset.
  173.  
  174. On the TI-92:
  175. Go to the home screen and press [F5] [DIAMOND] [(]. You will see 
  176. copyright notices and a ROM version.
  177.  
  178. If you go into VAR-LINK from the copyright screen and then exit back,
  179. the title bar of the VAR-LINK dialog will remain on the screen. The
  180. menu bar would have been redrawn at that point, but the copyright
  181. screen has no menu bar associated with it.
  182.  
  183. You can press [S] to go to the self-test. (Actually, you can press 
  184. any key that contains an "S", such as [COS] or [SIN]). The contrast 
  185. will be set to 13/31. The TI-92 will list a menu of things you can
  186. do. Pressing [Q] will quit this menu and set the con trast to 12/31.
  187. Simply going into this menu with [S] will do strange things to 
  188. memory; 3786 bytes will be added to system memory. If that much 
  189. memory isn't free, the menu won't be cleared when you press [Q] to 
  190. quit it. When you do quit the menu, the bottom dividing line on the
  191. screen will be gone permanently, and will never be redrawn until you
  192. reset the TI-92 or restore a backup.
  193.  
  194. From the copyright screen, you can also press [R]. This will return 
  195. to the home screen and the TI-92 will not respond to any keypresses 
  196. (except it will respond to modifiers, shift, diamond, and 2nd). What 
  197. is actually going on: the TI-92 is waiting to be controlled by 
  198. remote. To control it, send a two-byte word (raw) through the 
  199. linking port. The word must be in big-endian format (MSB before 
  200. LSB). This word will be interpreted as a key-code (these are listed 
  201. starting at page 484 of the manual). For example, 0x0041 is [A] and 
  202. 0x107 is [CLEAR]. All home screen output will be sent through the 
  203. linking port raw. To turn the TI-92 off, either send 0x210B 
  204. (diamond-off), take a battery out and put it back in, or wait 5.5 
  205. minutes for the TI-92's Auto Power Down to activate. When it is 
  206. turned back on, it will no longer be in remote control mode. 
  207. However, it will still be sending output to the linking port. To
  208. get out of this "link" mode, go back to the copyright notice and
  209. press [R] again. Staying in the "link" mode will allow you to
  210. cause the TI-92 to crash. Most methods of causing memory to run out
  211. will accomplish this quite well. Here are two examples.
  212.  
  213. 1) Type the following:
  214.  x|x=x
  215.  
  216. 2) Type the following:
  217.  "entry(1)" 
  218.  expr(entry(1))
  219.  expr(entry(1))
  220.  
  221. Variations on this theme will generate different crashes.
  222.  
  223. ---------------------------------------------------------------------
  224.  
  225. Here are some undocumented getkey() codes:
  226.  
  227.  [2nd] [Diamond]         [Hand] = 0xF1FE = 61950
  228.                  [Shift] [Hand] = 0x017C = 380
  229.  [2nd]           [Shift] [Hand] = 0x0160 = 352
  230.        [Diamond] [Shift] [Hand] = 0x0036 = 54
  231.  [2nd] [Diamond] [Shift] [Hand] = 0x0180 = 384
  232.  
  233.      [2nd] [ON] = 0x110B = 4363
  234.  [Diamond] [ON] = 0x210B = 8459
  235.  
  236. When you are editting a label in the geometry editor, 0x0100..0x01FF
  237. will generate ASCII characters. For example, pressing [Shift] [Hand]
  238. will generate the character "|".
  239.  
  240. ---------------------------------------------------------------------
  241.  
  242. The cursor keys are treated as a special case by the TI-92. Although
  243. there are 8 getkey() codes listed in the manual, there are only four
  244. hardware switches:
  245.  
  246.   [Left] = 0x151
  247.     [Up] = 0x152
  248.  [Right] = 0x154
  249.   [Down] = 0x158
  250.  
  251. When multiple switches are held down, these codes are ORed together.
  252. For example, pressing [Up] [Left] will generate 0x153; this is listed
  253. in the manual. However, if you take apart a TI-92, it becomes
  254. possible to press combinations that would be physically impossible
  255. otherwise. For example, pressing [Left] [Right] will generate 0x155,
  256. a code *not* listed in the manual.
  257.  
  258. You can hold down more than one modifier while pressing a cursor key.
  259. They are added up as follows:
  260.  
  261.      [2nd] = 0x1000
  262.  [Diamond] = 0x2000
  263.    [Shift] = 0x4000
  264.     [Hand] = 0x8000
  265.  
  266. For example, [2nd] [Diamond] [Left] generates 0x3151.
  267.  
  268. --------------------------------------------------------------------
  269.  
  270. The two rectangular [ENTER] keys are the same. But the curved one
  271. below the cursor pad is different from these two. If this sounds
  272. strange, try holding down one, pressing another, and releasing the
  273. first one. If the two were the same, only one [ENTER] would be
  274. registered. But if they were different, [ENTER] would be registered
  275. twice.
  276.  
  277. ---------------------------------------------------------------------
  278.  
  279. To move through a comment or label while editting it, you must use
  280. [Diamond] + an orthogonal cursor key, as said in the manual. As
  281. the following table shows, this actually generates an ASCII character.
  282. If you generate one of these characters yourself through the [CHAR]
  283. menu, it will in fact act as a cursor key.
  284.  
  285.  [Diamond] [Left]  = char(28)  = set union
  286.  [Diamond] [Right] = char(29)  = set intersection
  287.  [Diamond] [Up]    = char(30)  = is a subset of
  288.  [Diamond] [Down]  = char(31)  = is a member of
  289.  
  290. If you edit a label using F7:4, [Diamond]+cursor will work as it
  291. should. But there is also another way to edit a label. If you start
  292. typing immediately after creating a point (the point can be part of a
  293. multipoint object) a label will be created. You can only type a 5
  294. character label through this method. But, pressing [Diamond]+cursor
  295. while typing a label this way will generate a character rather than
  296. moving the cursor. Characters will be added at the end of the label
  297. until it reaches 5 characters or you press [ENTER]. You can then
  298. later edit the label with F7:4.
  299.  
  300. ---------------------------------------------------------------------
  301.  
  302. On the TI-92, strings can be manipulated as numbers. Try typing
  303.   "hello"+"hello"
  304. or
  305.   "hello"*"hello"
  306. or
  307.   "hello"/"hello"
  308.  
  309. My favorite application of this is using "" (the null string) as a 
  310. variable/constant. But you cannot solve an equation for "", since "" 
  311. is not a variable.
  312.  
  313. ---------------------------------------------------------------------
  314.  
  315. Here some TI-92 entries and their corresponding results:
  316.  
  317. 2^(a+b)
  318.   e^(ln(2)*(b+a))
  319.  
  320. 2^(a+b+c)
  321.   2^c*e^(ln(2)*(b+a))
  322.  
  323. 2^(a+b+c+d)
  324.   e^(ln(2)*(d+c))*e^(ln(2)*(b+a))
  325.  
  326. 2^(ln(a)+ln(b)+ln(c))
  327.   c^(ln(2))*b^(ln(2))*a^(ln(2))
  328.  
  329. 2^("a"+"b"+"c")
  330.   2^"a"*e^(ln(2)*("b"+"c"))
  331.  
  332. 2^(ln("a")+ln("b")+ln("c"))
  333.   "a"^(ln(2))*"b"^(ln(2))*"c"^(ln(2))
  334.  
  335. If Pretty Print is off, all occurences of "e^" will be deleted. If
  336. the result it pasted back, or converted to a string via the function
  337. "string()", the same thing will happen. However, if the result is
  338. used in a calculation, the "e^" will be retained.
  339.  
  340. From these results, we can deduce the following:
  341.  
  342. * Given any expression that, when simplified, contains "e^()" with
  343.   multiple terms inside the parentheses, when the expression is
  344.   converted to a string, either by auto-pasting or by the function
  345.   "string()", the "e^" will be deleted.
  346.  
  347. (pausing to catch my breath)
  348.  
  349. * If the base is a constant,
  350.  a) the variable exponents will be sorted in descending order
  351.  b) the constant exponents will be sorted in ascending order
  352.  
  353. * If the base is a variable,
  354.  a) the variable exponents will be sorted in ascending order
  355.  b) the constant exponents will be sorted in descending order
  356.  
  357. * The exponents will be divided into groups of two, and sorted in
  358.   the same order as they would be otherwise. If there are an odd
  359.   number of exponents, the first one will be placed alone, and the
  360.   "e^(" and "ln(" will cancel each other out.
  361.  
  362. * You should not place too much confidence in the TI-92's symbolic
  363.   manipulation. ;-)
  364.  
  365. NOTE: I have been told that this bug was fixed in version 1.5.
  366.  
  367. ---------------------------------------------------------------------
  368.  
  369. On a TI-92's home screen, typing
  370.   1|1=2
  371. will generate the "Constraint expression invalid" message. However, 
  372. you can type
  373.   1|1=x and x=2
  374. The answer will be 2.
  375.  
  376. ---------------------------------------------------------------------
  377.  
  378. On the TI-92, ans() and entry() are actually macros that are
  379. substituted at compile time, not run time. To prove this, type
  380. something in the home screen that will generate an answer. Write a
  381. program with the single line
  382.   ans()
  383. When you run it, it will compile. Edit it, and you'll find that 
  384. ans() was replaced with whatever the last answer was at the time.
  385. To use the answer at run-time, use something such as
  386.   expr("ans()")
  387. Speaking of which, you can use "expr" to execute statements as well 
  388. as evaluating expressions.
  389.  
  390. ---------------------------------------------------------------------
  391.  
  392. There is also another way to edit-lock programs on a TI-92. The
  393. Try...Else...EndTry structure has an alternate syntax (read: bug).
  394. The normal syntax is this:
  395.  
  396.  :Try
  397.  : [Block 1]
  398.  :Else
  399.  : [Block 2]
  400.  :EndTry
  401.  
  402. If Block 1 causes an error, the TI-92 jumps to Block 2.
  403. Here is a simplified, but equivalent, version of the same structure:
  404.  
  405.   Try:[Block 1]:Else:[Block 2]:EndTry
  406.  
  407. The "alternate" syntax is as follows:
  408.  
  409.   Try [Block 1]:Else:[Block 2]:EndTry
  410.  
  411. When this is tokenized by the TI-92, then converted back into text,
  412. everything following the "Try" will disappear.
  413.  
  414. To edit lock a program, insert the following construction at the
  415. beginning of the program:
  416.  
  417.   Try Else:EndTry
  418.  
  419. ---------------------------------------------------------------------
  420.  
  421. On a TI-92, type
  422.   56789:Return 123
  423. from the home screen, preferably in Pretty Print mode. Look at the 
  424. strange result. You can replace the numbers with anything you want. 
  425. The right side of the first expression will be chopped off according 
  426. to the length of the second expression. Various strange things can 
  427. be done with this result.
  428.  
  429. To edit-lock a program, first type
  430.   1:Return 1
  431. from the home screen. Then, create a program and put anything you 
  432. want in it. Make sure the first line is
  433.   If false:ans()
  434. After the program is compiled (run), view it from VAR-LINK. 
  435. Everything after the "If false:" will seem to be gone, but the 
  436. program will still run. When you edit the program, it will 
  437. permanently self-destruct. Who needs TI-Graph Link to edit lock a 
  438. program?
  439.  
  440. ---------------------------------------------------------------------
  441.  
  442. The TI-92 cannot integrate some simple expressions. Try
  443.   integ(deriv(e^(x^2+x),x),x)
  444. replacing "integ" and "deriv" and "e^" with their respective
  445. symbols. The integral should cancel the derivative, yielding
  446. "e^(x^2+x)". But instead, the TI-92 returns a result containing
  447. two new, unsolvable integrals. Here is the more general form of a
  448. solvable integral that is unsolvable by the TI-92:
  449.   integ(deriv(e^(f(x)+g(x)),x),x)
  450.  
  451. ---------------------------------------------------------------------
  452.  
  453. The TI-92 cannot solve some simple equations in exact mode.
  454.  
  455. Try
  456.   exact(solve(x^2/(x-2)^2=1,x))
  457. It cannnot solve that (the answer is 1). But it can solve
  458.   exact(solve(x^2=(x-2)^2,x))
  459. It can also correctly solve it if you replace "1" with a variable, 
  460. like this:
  461.   exact(solve(x^2/(x-2)^2=a,x))
  462.  
  463. ---------------------------------------------------------------------
  464.  
  465. You can make the TI-92 generate any error message outside a Try...
  466. Else...EndTry construction. Try
  467.   810->errornum:PassErr
  468. replacing "->" with the STO> symbol. The error codes are listed
  469. starting at page 472 of the manual. The undocumented codes are:
  470.   1020-1029: Internal error
  471.   1030-4094: Protected memory violation
  472.   4095-32767: Unknown ERROR code
  473.   0-9 or 32767-65535: (ignored -- no error message)
  474. Where 100-109 means that any number from 100 to 109 will generate 
  475. the error. Error numbers are truncated to make the value fall
  476. between 0 and 65535.
  477.  
  478. ---------------------------------------------------------------------
  479.  
  480. On a TI-92, go to VAR-LINK and view any variable or folder with
  481. [F6]. Turn the TI-92 off with [DIAMOND] [ON]. Turn it back on. The
  482. contents window will disappear.
  483.  
  484. Press [DIAMOND] [K] to bring up the list of keys. Turn the TI-92 off 
  485. with [DIAMOND] [ON]. Turn it back on. The keyboard window will 
  486. disappear, but this time the TI-92 will also turn itself off again.
  487.  
  488. Notice that both the contents window and the keyboard window have 
  489. the same border.
  490.  
  491. ---------------------------------------------------------------------
  492.  
  493. In the TI-92, there is a While...EndWhile loop but there is no built
  494. in Repeat...Until loop. There is a quick way to do it however.
  495. As a replacement for
  496.   Repeat:...:Until x
  497. Use
  498.   Loop:...:If not(x):EndLoop
  499. You do not need to use
  500.   Loop:...:If x:Exit:EndLoop
  501.  
  502. ---------------------------------------------------------------------
  503.  
  504. This TI-92 bug happens when you are very low in memory. Press [2nd]
  505. [RCL] and then [DIAMOND] [K]. Type something to cancel the keyboard
  506. window, such as [SPACE]. The contents of the "Recall" window will be
  507. erased, and only changes will be updated. This also works for other
  508. windows that ask you to input a string, such as "Save Copy As" and
  509. "New".
  510.  
  511. ---------------------------------------------------------------------
  512.  
  513. There is a bug in the TI-92's "Send" command. This command is used to
  514. send data to the CBL unit. The data must be in the form of a
  515. numerical list. In normal use, such a list is very small. If you try
  516. to send a list with more than 128 entries, the TI-92 will crash.
  517.  
  518. ---------------------------------------------------------------------
  519.