TI 58/59 Fast Mode

Back to main page If this is useful to you, Email me at: Genewright143@hotmail.com


Most of this material comes from TI PPC Notes V8N4P5 and Texas Instruments' PPX-59 V5N4. circa 1981.

You can try to email me about this, but I have just found this old material myself and can't answer many questions. Your best source for further information is to drop me an email so I can pass along the mailing address of the former editor of TI PPC Notes.

Soon after the TI-59 became available, users found that code executed from a library module would run faster than the same code when downloaded into user memory. Routine C of Master Library program 16 will take approximately twice as long to figure the factorial of 69 when in user memory than when run from the module. Try it yourself and you'll see.

Is there a way of getting programs in user memory to run as fast as they would in a library module? Yes. However, there are some limitations and restrictions:

1) Execution of the program in fast mode starts at the step set by the number in the display when the program hits the instructions that put it into fast mode. When accessing fast mode, the calculator will jump to address 8*(WXY) + Z + 1, where WXYZ are the ninth through twelth decimal digits after the number one. A 2 is needed in the 13th position for fast mode entry, regardless of where you want execution to begin. For example, if you want the fast mode program to begin running at step #1, then all you need to have in the display when the fast mode is initiated is 2 EE -12 + 1. To have execution of a program begin at step 230 (if that's where you want it to start for some reason), then the ninth through twelth digits need to be 0285 (028 * 8 + 5 + 1 = 230), so the number that needs to be in the display would be 1.000000002852. Entered by 2.852 EE -9 + 1.

2) Once a program is running in fast mode, it cannot be stopped by pressing R/S or RST. If a stop is not provided by the program, it will be necessary to turn the calculator off to regain control.

3) The RTN command (code 92 entered by INV SBR) cannot be used as an alternate to the R/S command (code 91) even if the RTN is preceded by one of the commands listed in the item #4.

4) An attempt to change the location of the program pointer from the keyboard with a GTO nnn sequence will remove the calculator from the fast mode and may cause other complications.

5) IMPORTANT: Subroutines may not be used in fast mode. This includes the callup of library programs with sequences such as Pgm MM with any of the options on page V-62 of the "Personal Programming".

6) Neither user defined labels nor common labels can be used with transfer instructions like GTO, the "t" register comparisons, the DSZ, or the flag tests. In other words, the transfer address must always be an absolute address.

7) Some operations do not run at increased speed in fast mode. Examples include the trigonometry functions, statistics and conversion functions.

That's quite a list of limitations and there may be a few more such as all the flags being reset upon entry into fast mode.

To enter fast mode, you must have these instructions at the end of the current calculator partition: STF IND. That's set flag, Indirect. If you have a program running with 480 program steps, then step 478 and 479 should be STF IND. These instructions need a 2E-12 to be in the display when they are run to work to transfer execution to step zero and a different number as described in #1 above for transfer to a different step. These functions with the instructions given below, put the calculator into fast mode.

Analyze the program given below and you'll see how to do it. Don't ask me why this works, it just does. Or better yet, get some back issues of the TI PPC notes and read it yourself.

Here's the sample program to illustrate it. This program will calculate the exact factorial of any number up to 461! on the TI-59 and about 150? on the TI-58. The program can be modified to run on a TI-58 by changing all memory operations that point at memories in the 90-99 range to use 30-39. Also, on the TI-58, change step 58 to 00 and step 59 to 04, to set the partition at 160 steps and 40 memories.

The original program was written by Peter Messer. This program calculates 34! in 1 minute 21 seconds and 100! in 10 minutes 30 seconds.


Instructions:

1) Enter the program.

2) Press A to initialize. See a zero in the display.

3) To find n!

a) Enter the first factor and press B.

b) Enter the second factor and press C. (Probably use a 2 for the first factor and a three for this one).

c) Enter n (the number you want the exact factorial of) and press D. See a flashing 1 in the display. Ignore the flashing and press 7 and then press EE. The calculator will be in fast mode. You will be unable to interrupt operation with either RST or R/S. A "-0" in the display (yes, that's a negative zero), signals the end of the calculation.

d) Press E to display the first sequence of digits in the factorial. Press R/S to each remaining block of digits. The number of trailing zeroes will be displayed as a negative integer.

Sample Results:

34! is equal to : 29,523,279,939,604,140,847,618,609,643,520,000,000.

69! is equal to : 171122452428141311372468338881272839092270

544893520369393648040923257279754140647424000000000000000.

Here's the program. Note: DIV is the divide key. RC* and ST* etc. are Recall Indirect, Store Indirect, etc. Be sure to record the program on a card on the TI-59 in case you incorrectly keyed it in and must turn the 59 off to recover. If you mess up like that on the TI-58C, then turn it off and back on and the program will still be in memory to debug.

Step CODE Function
000    91   R/S
001    01    1
002    44   SUM
003    98    98
004    42   STO
005    00   00
006    73   RC*
007    00   00
008    65    X
009    43   RCL
010    98   98
011    85   +
012    43   RCL
013    94   94
014    59   INT
015    95    =
016    67   EQ
017    01   01
018    09   09
019    55   DIV
020    43   RCL
021    99   99
022    95   =
023    42   STO
024    94   94
025    22   INV
026    59   INT
027    65    X
028    43   RCL
029    99   99
030    95   =
031    63   EX*
032    00   00
033    69   OP
034    20   20
035    61   GTO
036    00   00
037    06   06
038    68   NOP
039    76   LBL
040    14   D
041    75   -
042    43   RCL
043    98   98
044    85   +
045    01   1
046    22   INV
047    44   SUM
048    98   98
049    95   =
050    42   STO
051    95   95
052    61   GTO
053    01   01
054    45   45
055    76   LBL
056    11   A
057    47   CMS
058    01   1
059    00   0
060    69   OP
061    17   17
062    01   1
063    52   EE
064    01   1
065    00   0
066    42   STO
067    99   99
068    25   CLR
069    91   R/S
070    76   LBL
071    12   B
072    69   OP
073    20   20
074    72   ST*
075    00   00
076    91   R/S
077    61   GTO
078    00   0
079    72   72
080    76   LBL
081    13   C
082    42   STO
083    98   98
084    91   R/S
085    76   LBL
086    15   E
087    43   RCL
088    97   97
089    42   STO
090    00   00
091    73   RC*
092    00   00
093    91   R/S
094    97   DSZ
095    00   00
096    00   00
097    91   91
098    43   RCL
099    96   96
100    65   X
101    01   1
102    00   0
103    95   =
104    94   +/-
105    91   R/S
106    61   GTO
107    00   00
108    87   87
109    69   OP
110    30   30
111    43   RCL
112    00   00
113    67   EQ
114    01   01
115    25   25
116    42   STO
117    97   97
118    97   DSZ
119    95   95     (NOTE: Read below on entering this step)
120    00   00
121    01   01
122    25   CLR
123    94   +/-
124    81   RST
125    43   RCL
126    97   97
127    42   STO
128    00   00
129    00   0
130    63   EX*
131    00   00
132    97   DSZ
133    00   00
134    01   01
135    30   30
136    01   1
137    44   SUM
138    96   96
139    61   GTO
140    00   00
141    04   04
142    00   00
143    00   00
144    00   00
145    02   2
146    52   EE
147    01   1
148    02   2
149    94   +/-
150    85   +
151    01   1
152    95   =
153    22   INV
154    52   EE
155    58   FIX
156    00   00
157    60   DEG
158    86   STF
159    40   IND

That's it. Enter the DSZ 95 instruction by typing a DSZ 0 001, then go back and delete the zero just after the DSZ and type the equal key. For the TI 58, since you are changing all memory references to 90-99 to 30-39, then this step needs to be a code 35.

Now for the disclaimers: This is presented solely as an item of interest to TI 58/59 users. Although many people have used this for a long time, you do so at your own risk. I accept no responsibility for anything that happens. Is this useful to anyone?

Visitors since 5/10/97