TI-84 Plus programming

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Prelates, Moderators General

TI-84 Plus programming

Postby Kurushimi » Tue Mar 17, 2009 9:46 pm UTC

Is there any way I can write a program using a regular keyboard and load it into my TI-84? Maybe even test it through an emulator if I don't happen to have the calculator with me? I've been interested in programming with my calculator but the typing it in the calculator part has been putting me off.
User avatar
Kurushimi
 
Posts: 842
Joined: Thu Oct 02, 2008 12:06 am UTC

Re: TI-84 Plus programming

Postby darkspork » Tue Mar 17, 2009 10:26 pm UTC

Yes.

Mac: Just install the TI software that came on the disk and you can code it there.

Windows: I once made this in Visual Basic 6. You can use TI software to upload/download the programs and this to edit them. You also need the TI84plusPC font. I think it's in the zip, but it's also on the TI disk. If people want the source, I'll post it too. All my software really does is a find+replace operation, replacing the text values (See TEXT.txt) with respective TI tokens (TI.txt). There's also a file header and a checksum. I'll go search for it...

Linux: Not so sure. :\
Last edited by darkspork on Tue Mar 17, 2009 10:34 pm UTC, edited 1 time in total.
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby Kurushimi » Tue Mar 17, 2009 10:31 pm UTC

Thanks, but when I attempt to run your program, I get the following error

Run-time error '339':
Component 'comdlg32.ocx' or one of it's dependencies not correctly registered: a file is missing or is invalid
User avatar
Kurushimi
 
Posts: 842
Joined: Thu Oct 02, 2008 12:06 am UTC

Re: TI-84 Plus programming

Postby darkspork » Tue Mar 17, 2009 10:40 pm UTC

Ah. That one. *looks for the file... [url="http://home.adelphi.edu/~cd17347/COMDLG32.OCX"]this[/url] (I think that file was from Windows 95 or something. Toss it in the same directory as the EXE. Should work now. If not, I'm researching the .8xp format header)

.8xp format:

Code: Select all
Standard header: **TI83F*
ASCII characters: 1A 0A 00
42 character comment: Made by Spork Interactive TIIDE v2.0.03   
The next two bytes are the length of the program + 19
ASCII characters: 0D 00
Next two bytes are length of the program + 2
Next byte is protect flag: ASCII 06 for protect, 05 for no protect
Eight character program name: CALCTEST
Two null characters: 00 00
Next two bytes are length of the program + 2
Next two bytes are length of the program

<program code>

checksum (2 characters): sum of the bytes of the program code, modulo (2 ^ 16)
Last edited by darkspork on Tue Mar 17, 2009 10:58 pm UTC, edited 4 times in total.
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby Outchanter » Tue Mar 17, 2009 10:42 pm UTC

Kurushimi wrote:Thanks, but when I attempt to run your program, I get the following error

Run-time error '339':
Component 'comdlg32.ocx' or one of it's dependencies not correctly registered: a file is missing or is invalid

Good old Visual Basic and its "let's shove everything into an ActiveX control" attitude.

You can download the file though (edit: or use spork's link). Several pages also give instructions for registering it, which you'll probably need to do.
~ You will eat a tasty fortune cookie. Oh look, it came true already! ~
User avatar
Outchanter
 
Posts: 671
Joined: Mon Dec 17, 2007 8:40 am UTC
Location: South African in Americaland

Re: TI-84 Plus programming

Postby darkspork » Tue Mar 17, 2009 11:21 pm UTC

Outchanter wrote:Several pages also give instructions for registering it, which you'll probably need to do.

You don't need to register it if you just throw it in the same folder as the EXE
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby Outchanter » Tue Mar 17, 2009 11:30 pm UTC

darkspork wrote:
Outchanter wrote:Several pages also give instructions for registering it, which you'll probably need to do.

You don't need to register it if you just throw it in the same folder as the EXE

Ok. I suppose you only need to register it if you want to run multiple programs that depend on it without multiple copies?
~ You will eat a tasty fortune cookie. Oh look, it came true already! ~
User avatar
Outchanter
 
Posts: 671
Joined: Mon Dec 17, 2007 8:40 am UTC
Location: South African in Americaland

Re: TI-84 Plus programming

Postby darkspork » Wed Mar 18, 2009 1:05 am UTC

Outchanter wrote:
darkspork wrote:
Outchanter wrote:Several pages also give instructions for registering it, which you'll probably need to do.

You don't need to register it if you just throw it in the same folder as the EXE

Ok. I suppose you only need to register it if you want to run multiple programs that depend on it without multiple copies?

Yes - the process of "registering" any component involves placing the file in the System (or System32) (Is there a Ssytem64 too?) folder, then adding it to a table so it can be used globally. If only one program uses it, then it works fine in the same folder as that program.
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby Ventanator » Thu Mar 26, 2009 10:29 pm UTC

When I try and run your program, I get Runtime Error 53: File Not Found.....I downloaded and unzipped it. Unless I'm way worse at computers than I thought, it should work, right?

Do you have any idea what's wrong? (I'm running Vista by the way)
User avatar
Ventanator
 
Posts: 158
Joined: Thu Mar 26, 2009 10:22 pm UTC

Re: TI-84 Plus programming

Postby darkspork » Fri Mar 27, 2009 5:38 am UTC

Ventanator wrote:When I try and run your program, I get Runtime Error 53: File Not Found.....I downloaded and unzipped it. Unless I'm way worse at computers than I thought, it should work, right?

Do you have any idea what's wrong? (I'm running Vista by the way)

It's probably some sort of Vista thing. VB6 outdates XP. W/e I'm learning Python now. Should have a simple script to convert it as soon as I figure out file I/O. (Although from what I've experienced so far, I assume it will be easy.)
Spoiler:
Image

^^ I finally get this comic... and feel the same way
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby Berengal » Fri Mar 27, 2009 10:08 am UTC

darkspork wrote:Should have a simple script to convert it as soon as I figure out file I/O. (Although from what I've experienced so far, I assume it will be easy.)

Either
Code: Select all
file = open("filename")
#...
file.close()

Or
Code: Select all
with open("filename") as file:
  #...

'open("filename","w")' for write mode.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: TI-84 Plus programming

Postby darkspork » Fri Mar 27, 2009 11:25 pm UTC

Spoiler:
Code: Select all
# A simple script to convert TI83/84 program files (.8xp) to raw text and back.

__author__ = "Spork Interactive"
__version__ = "$Revision: 1.0 $"
__date__ = "$Date: 2009/03/27 $"
__copyright__ = "Copyright (c) 2009 Spork Interactive"
__license__ = "Python"

def loadDict(directory=".", dictType="compile"):
    """Load the TI and TEXT files, make dictionaries.
    Specify which kind of dictionary (compile/decompile).
   
    Returns the dictionary."""
    try:
        tiFile = open("%s/TI.txt" % directory, "r")
        tiFileData = tiFile.read().split("\r\n")
        try:
            txFile = open("%s/Text.txt" % directory, "r")
            txFileData = txFile.read().split("\r\n")
            # The TI and TX files were made on a Windows
            # machine, and use linefeed+carriage return
            # to separate items
            if dictType == "compile":
                return dict(zip(txFileData, tiFileData))
            if dictType == "decompile":
                return dict(zip(tiFileData, txFileData))
            txFile.close()
        except IOError:
            print """Error loading the Text dictionary.
Are you sure Text.txt exists in %s?""" % directory
        finally:
            tiFile.close()
    except IOError:
        print """Error loading the TI dictionary.
Are you sure TI.txt exists in %s?""" % directory

def longestKey(dictionary):
    return max([len(k) for k, v in dictionary.items()])

def decompile(source8xp, destination):
    """Decompile a .8xp file, save that to destination file"""
    tDict = loadDict(dictType="decompile")
    maxKeyLen = longestKey(tDict)
    try:
        readFile=open(source8xp, "r")
        try:
            writeFile=open(destination, "w")
            try:
                # Load program name and protection type
                readFile.seek(59, 0)
                protect = readFile.read(1) == "\x05" and "not " or ""
                name = readFile.read(8)
                writeFile.write("%s\n%sprotected\n" % (name, protect))
                print "Loading %s..." % name
                print "Program is %sprotected" % protect
                # Find data's end
                readFile.seek(-2, 2)
                fileLength = readFile.tell()
                # Read program meat
                readFile.seek(74, 0)
                while readFile.tell() < fileLength: # Ignore the last 2 bytes (checksum)
                    current = readFile.read(maxKeyLen)
                    readLen = maxKeyLen
                      # Try each possible key for the next few characters
                    while (not tDict.has_key(current) and readLen>0):
                        readFile.seek(-1*readLen, 1)
                        readLen -= 1
                        current = readFile.read(readLen)
                        if readLen==0:
                            print "{%s}?" % current
                            writeFile.write("{%s}?" % current)
                            # A character is unreadable!
                        else:
                            writeFile.write(tDict[current])
                print "%s successfully decompiled as %s" % (source8xp, destination)
            except IOError:
                print "An error occurred during translation"
            finally:
                writeFile.close()
        except IOError:
            print "Error creating %s!" % destination
        finally:
            readFile.close()
    except IOError:
        print "Error loading %s!" % source8xp


The above Python code should decompile (compiling is a bit trickier) but seems to be randomly dropping a few symbols. You'll need the TI.txt and Text.txt files from my previous post to load up a dictionary. Alternatively, here's the parsed dictionary for decompiling:
Code: Select all
{'\x8b': 'ZSquare', '\x10': '(', '\xef\x01': 'setTime(', 'b\n': 'minY', '\x9b': 'RecallGDB ', ' ': 'randM(', '\xab': 'rand', '\xef\x00': 'setDate(', '0': '0', 'b\x11': '\xc6xy', '@': ' and ', '\xcb': 'cosh\xf1(', 'P': 'P', '\xdb': 'DS<(', '\xeb': '\xe1', 'p': '+', '?': '\n', '\xfb': 'ClrTable', '\x80': '\xd1', '\x0b': '\xdf', '\x90': 'ZoomRcl', '\xde': 'Disp ', '\x1b': 'R\xe5Pr(', '\xbb\x1c': 'tpdf(', '\xa0': 'Pt-Change(', '+': ',', '\xb0': '\xfa', '\xaa\x08': 'Str9', ';': '\xfb', '\xaa\t': 'Str0', '\xc0': 'log(', 'K': 'K', '\xaa\x04': 'Str5', '\xaa\x05': 'Str6', '[': '\xc1', '\xaa\x06': 'Str7', '\xe0': 'Output(', '\xaa\x07': 'Str8', '\xaa\x00': 'Str1', 'k': '<', '\xaa\x01': 'Str2', '\xf0': '^', '\xaa\x02': 'Str3', '{': 'IndpntAsk', '\xaa\x03': 'Str4', '\x81': '\xd2', '\x06': '[', '\x16': 'row+(', '\xa1': 'Pxl-On(', '`\x03': 'Pic4', '`\x00': 'Pic1', '`\x01': 'Pic2', '`\x06': 'Pic7', '`\x07': 'Pic8', '`\x04': 'Pic5', '`\x05': 'Pic6', '`\x08': 'Pic9', '`\t': 'Pic0', '\xb1': 'int(', '6': '6', '\xc1': '10^(', 'F': 'F', '\xd1': 'While ', 'V': 'V', '\xe1': 'ClrHome', 'f': 'Normal', '\xf1': '\xcd\xf0', 'v': 'Func', '\x01': '\xe5DMS', '\x86': 'ZStandard', '\x11': ')', '\x96': 'FnOn ', '!': 'mean(', '\xa6': 'Horizontal ', '1': '1', '\xb6': 'sum(', 'A': 'A', '\xc6': 'tan(', 'Q': 'Q', '\xef\x12': 'ExecLib ', '\xd6': 'Lbl ', '\xe6': 'Menu(', 'q': '-', '\xef\x11': 'OpenLib(', '\xf6': 'LnReg ', '\x87': 'ZTrig', '\x0c': '\xf1', '\xef\x10': 'ClockOff', '\x97': 'FnOff ', '\x1c': 'R\xe5P\xc1(', '\xa7': 'Tangent(', '\xf9': 'QuadReg ', ',': '\xe0', '\xb7': 'prod(', '<': ' or ', '\xc7': 'tan\xf1(', 'L': 'L', '\xbb\xcb': '\xc7', '\xd7': 'Goto ', '\xe7': 'Send(', 'l': '>', '\xf7': 'PwrReg ', '\xbe': 'ln(', '|': 'DependAuto', '\xff\xff': '%@-(##2&842)()%', '\x07': ']', '\x8c': 'ZInteger', '\x17': '*row(', '\x9c': 'Line(', "'": 'fMin(', '\xac': '\xc4', '7': '7', '\xbc': '\xf0(', 'G': 'G', '\xcc': 'tanh(', '\xbbL': 'Pmt_Bgn', 'W': 'W', '\xce': 'If ', '\xdc': 'Input ', 'g': 'Sci', '\xec': 'Plot1(', 'w': 'Param', '\xfc': 'Histogram', '\x02': '\xe5DEC', '\x8d': 'ZPrevious', '\xbb\xab': '\xc9', '\x12': 'round(', '^\x80': 'u', '^\x81': 'v', '^\x82': 'w', '\x9d': 'Vertical ', '"': 'solve(', '\xad': 'getKey', '2': '2', '\xbf': '\xeb^(', '\xbd': '\xd5\xf0(', 'B': 'B', '\xcd': 'tanh\xf1(', 'R': 'R', '\xdd': 'Prompt ', '\n\xff': 'aleu(#*%fh)(#@R', '\xed': 'Plot2(', '\xbb\x9b': '\xd9', 'r': 'Ans', '\xfd': 'xyLine', '^\x18': 'Y\x89', '^\x19': 'Y\x80', '\x82': '*', '^\x10': 'Y\x81', '^\x11': 'Y\x82', '^\x12': 'Y\x83', '^\x13': 'Y\x84', '^\x14': 'Y\x85', '^\x15': 'Y\x86', '^\x16': 'Y\x87', '^\x17': 'Y\x88', '\x92': 'ZoomSto', '\xee': 'Plot3(', '\x1d': 'P\xe5Rx(', '\xa2': 'Pxl-Off(', '-': '!', '^(': 'X\x85\xd4', '^)': 'Y\x85\xd4', '^*': 'X\x86\xd4', '\xb2': 'abs(', '^ ': 'X\x81\xd4', '^!': 'Y\x81\xd4', '^"': 'X\x82\xd4', '^#': 'Y\x82\xd4', '^$': 'X\x83\xd4', '^%': 'Y\x83\xd4', '^&': 'X\x84\xd4', "^'": 'Y\x84\xd4', '\xc2': 'sin(', 'M': 'M', '\xbb\x8b': '\xa7', '\xd2': 'Repeat ', '^@': 'r\x81', '^A': 'r\x82', '^B': 'r\x83', '^C': 'r\x84', '^D': 'r\x85', '^E': 'r\x86', '\xe2': 'Fill(', '~\x10': 'uvAxes', '~\x11': 'uwAxes', '~\x12': 'vwAxes', 'm': '\xf7', '~\x08': 'AxesOn', '~\t': 'AxesOff', '~\n': 'GridOn', '~\x0b': 'GridOff', '~\x0c': 'LabelOn', '~\r': 'LabelOff', '~\x0e': 'Web', '~\x0f': 'Time', '~\x00': 'Sequential', '~\x01': 'Simul', '~\x02': 'PolarGC', '~\x03': 'RectGC', '~\x04': 'CoordOn', '~\x05': 'CoordOff', '~\x06': 'Connected', '~\x07': 'Dot', '\x83': '/', '\x08': '{', '\x93': 'Text(', '\x18': '*row+(', '\xa3': 'Pxl-Change(', '(': 'fMax(', '\xb3': 'det(', '8': '8', '\xc3': 'sin\xf1(', 'H': 'H', '\xd3': 'For(', 'X': 'X', '\xe3': 'SortA(', 'h': 'Eng', '\xf3': '2-VarStats ', 'x': 'Polar', '\\\x03': '[D]', '\x03': '\xe5FRAC', '\x88': 'ZBox', '\x13': 'pxl-Test(', '\xef\n': 'getTime', '\x98': 'StorePic ', '#': 'seq(', '\xa8': 'DrawInv ', '3': '3', '\x9f': 'Pt-Off(', '\xb8': 'not(', 'C': 'C', '\xc8': 'sinh(', '\xfe': 'Scatter', ']\x05': 'L\x86', ']\x04': 'L\x85', 'S': 'S', ']\x01': 'L\x82', ']\x00': 'L\x81', ']\x03': 'L\x84', ']\x02': 'L\x83', '\xd8': 'Pause ', '\xd0': 'Else', '\xe8': 'Get(', 's': 'Fix', '\xf8': 'Med-Med ', '\xbbs': '\x8f', '\xbbr': '\x8e', '\xbbq': '\x8d', '\xbbp': '\x8c', '\xbbw': '\x93', '\xbbv': '\x92', '\xbbu': '\x91', '\xbbt': '\x90', '\x89': 'Zoom In', '\xbbz': '\x96', '\xbby': '\x95', '\xbbx': '\x94', '\xbb\x7f': '\x9b', '\xef\x02': 'checkTmr(', '\xbb}': '\x99', '\x0e': '\xf6', '\xbbg': 'DiagnosticOff', '\xbbf': 'DiagnosticOn', '\xbbe': 'ZoomFit', '\xbbd': 'G-T', '\x99': 'RecallPic ', '\xbbj': 'Asm(', '\xbbi': 'UnArchive ', '\xbbh': 'Archive ', '\xbbo': '\x8b', '\xbbn': '\x8a', '\xbbm': 'compiled asm', '\x1e': 'P\xe5Ry', '\xbbS': 'GetCalc(', '\xbbR': 'ClrAllLists', '\xbbQ': 'ExprOff', '\xbbP': 'ExprOn', '\xbbW': 'Clear Entries', '\xbbV': 'String\xe5Equ(', '\xbbU': 'Equ\xe5String(', '\xbbT': 'DelVar ', '\xa9': 'DrawF ', '\xbbZ': 'ModBoxplot', '\xbbY': 'ANOVA(', '\xbbX': 'Select(', '.': 'CubicReg', '\xbbC': '1-PropZInt(', '\xbbB': '2-SampZInt(', '\xbbA': 'ZInterval ', '\xbb@': '\xe4\xdc-Test(', '\xbbG': '2-Samp\xe3Test ', '\xbbF': '2-SampTTest ', '\xbbE': 'GraphStyle(', '\xbbD': '2-PropZInt(', '\xb9': 'iPart(', '\xbbJ': 'SetUpEditor ', '\xbbI': '2-SampTInt ', '\xbbH': 'TInterval ', '\xbbO': 'a+b\xe0', '\xbbN': 'r\xeb^\xc1\xe0', '\xbbM': 'Real', '>': ':', '\xbb3': 'Logistic ', '\xbb2': 'SinReg ', '\xbb1': '\xeb', '\xbb0': '\xe5Polar', '\xbb7': 'Shade\xe4\xdc', '\xbb6': 'Shade_t(', '\xbb5': 'ShadeNorm(', '\xbb4': 'LinRegTTest ', '\xbb;': 'Z-Test(', '\r': '\xdc', '\xbb9': 'Matr\xe5list(', '\xbb8': 'Shade\xe3(', '\xbb?': '2-PropZTest(', '\xbb>': '1-PropZTest(', '\xbb=': '2-SampZTest(', 'N': 'N', '\xbb#': 'tmv_N', '\xbb"': 'tmv_PV', '\xbb!': 'tmv_I%', '\xbb ': 'tmv_Pmt', "\xbb'": 'imag(', '\xbb&': 'real(', '\xbb%': 'conj(', '\xbb$': 'tmv_FV', '\xbb+': 'length(', '\xbb*': 'expr(', '\xbb)': 'cumSum(', '\xbb(': 'angle(', '\xbb/': '\xe5Rect', '\xbb.': 'rref(', '\xbb-': 'ref(', '\xbb,': '\xeeList(', '\xbb\x13': '\xe4\xdccdf(', '\xbb\x12': 'tcdf(', '\xbb\x11': 'invNorm(', '\xbb\x10': 'normalcdf(', '\xbb\x17': 'poissonpdf(', '\xbb\x16': 'binomcdf(', '\xbb\x15': 'binompdf(', '\xbb\x14': '\xe3cdf(', '\xbb\x1b': 'normalpdf(', '\xbb\x1a': 'geometcdf(', '\xbb\x19': 'geometpdf(', '\xbb\x18': 'poissoncdf(', '\xbb\x1f': 'randNorm(', '\xbb\x1e': '\xe3pdf(', '\xbb\x1d': '\xe4\xdcpdf(', 'n': '\xf9', '\xbb\x03': '\xc6prn(', '\xbb\x02': 'bal(', '\xbb\x01': 'irr(', '\xbb\x00': 'npv(', '\xbb\x07': 'dbd(', '\xbb\x06': '\xe5Eff(', '\xbb\x05': '\xe5Nom(', '\xbb\x04': '\xc6Int(', '\xbb\x0b': 'randBin(', '\xbb\n': 'randInt(', '\xbb\t': 'gcd(', '\xbb\x08': 'lcm(', '\xbb\x0f': 'inString(', '\xbb\x0e': 'variance(', '\xbb\r': 'stdDev(', '\xbb\x0c': 'sub(', '\t': '}', '\x8e': 'ZDecimal', '\x19': 'max(', '\x9e': 'Pt-On(', '\xbb\xd3': '$', '\xbb\xd2': '#', '\xbb\xd1': '@', '\xbb\xd7': '\\', '\xbb\xd6': ';', '\xbb\xd5': '`', '\xbb\xd4': '&', ')': ' ', '\xbb\xda': '%', '\xbb\xd9': '_', '\xbb\xd8': '|', '\xae': "'", '\xbb\xc2': 'r', '\xbb\xc1': 'q', '9': '9', '\xbb\xca': 'z', '\xbb\xc9': 'y', '\xbb\xc8': 'x', '\xbb\xcf': '~', '\xbb\xce': 'GarbageCollect', '\xbb\xcd': '\x9a', '\xbb\xcc': '\xc8', '\xbb\xb7': 'h', '\xbb\xb6': 'g', '\xbb\xb5': 'f', 'I': 'I', '\xbb\xba': 'k', '\xbb\xb9': 'j', '\xbb\xb8': 'i', '\xbb\xbf': 'o', '\xbb\xbd': 'm', '\xbb\xbc': 'l', '\xbb\xa3': '\xbf', '\xbb\xa2': '\xee', '\xbb\xa1': '\xbd', '\xbb\xa0': '\xbc', '\xbb\xa6': '\xc3', '\xbb\xa5': '\xc2', '\xbb\xa4': '\xc0', 'Y': 'Y', '\xbb\xa9': '\xc6', '\xbb\xa8': '\xc5', '\xbb\xaf': '\xe3', '\xbb\xae': '\xe4', '\xbb\xad': '\xea', '\xbb\xac': '\xca', '\xbb\x93': '\xaf', '\xbb\x92': '\xae', '\xbb\x91': '\xad', '\xbb\x90': '\xac', '\xbb\x97': '\xb3', '\xbb\x95': '\xb1', '\xbb\x94': '\xb0', 'i': 'Float', '\xbb\x9a': '\xd8', '\xbb\x99': '\xb5', '\xbb\x98': '\xb4', '\xbb\x9f': '\xbb', '\xbb\x9e': '\xba', '\xbb\x9d': '\xb9', '\xbb\x9c': '\xdb', '\xbb\x83': '\x9f', '\xbb\x82': '\x9e', '\xbb\x81': '\x9d', '\xbb\x80': '\x9c', '\xbb\x87': '\xa3', '\xbb\x86': '\xa2', '\xbb\x85': '\xa1', '\xbb\x84': '\xa0', 'y': 'Seq', '\xbb\x8a': '\xa6', '\xbb\x89': '\xa5', '\xbb\x88': '\xa4', '\xbb\x8f': '\xab', '\xbb\x8e': '\xaa', '\xbb\x8d': '\xa9', '\xbb\x8c': '\xa8', '\xef\x0f': 'ClockOn', '\x04': '\xfc', '\xef\x0e': 'isClockOn', '\xef\r': 'getTmFmt', '\x8f': 'ZoomStat', '\\\x06': '[G]', '\\\x07': '[H]', '\\\x04': '[E]', '\\\x05': '[F]', '\\\x02': '[C]', '\x14': 'augment(', '\\\x00': '[A]', '\\\x01': '[B]', '\xef\x0b': 'startTmr', '\\\x08': '[I]', '\\\t': '[J]', '\xe9': 'PlotsOn ', '$': 'fnInt(', '\xef\x08': 'getTmStr(', '\xaf': '?', '\xbb{': '\x97', '^+': 'Y\x86\xd4', '4': '4', '\xef\x06': 'DayOFWk(', '\xef\x05': 'timeCnv(', '\xbbk': 'AsmComp(', '\xef\x04': 'setTmFmt(', 'D': 'D', '\xef\x03': 'setDtFmt(', '\xcf': 'Then', 'T': 'T', '\xbb|': '\x98', '\xdf': 'DispGraph', 'd': 'Radian', '=': ' xor ', 't': 'Horiz', '\xff': 'LinReg(ax+b) ', 'b$': 't', 'b%': '\xe4\xdc', 'b&': '\xe3', "b'": 'df', 'b ': 'y\x83', '\x84': 'Trace', 'b"': 'p', 'b#': 'z', 'b,': 'Sx\x81', 'b-': 'n\x81', 'b.': '\xcb\x82', 'b/': 'Sx\x82', 'b(': '\xea', 'b)': '\xea\x81', '\x0f': '\xd5', 'b+': '\xcb\x81', 'b4': 's', 'b5': 'r\xdc', 'b6': 'R\xdc', 'b0': 'n\x82', 'b1': 'Sxp', 'b2': 'lower', 'b3': 'upper', '\x1f': 'median(', 'b\x04': '\xc6x', 'b\x05': '\xc6x\xdc', 'b\x06': 'Sx', 'b\x07': '\xc7x', 'b\x01': 'RegEq', 'b\x02': 'n', 'b\x03': '\xcb', 'b\x0c': '\xcc', 'b\r': '\xc6y', 'b\x0e': '\xc6y\xdc', 'b\x0f': 'Sy', 'b\x08': 'minX', 'b\t': 'maxX', '/': 'QuartReg', 'b\x0b': 'maxY', 'b\x14': 'Q\x81', 'b\x15': 'Q\x83', 'b\x16': 'a', 'b\x17': 'b', 'b\x10': '\xc7y', '\xb4': 'identity(', 'b\x12': 'r', 'b\x13': 'Med', 'b\x1c': 'x\x82', 'b\x1d': 'x\x83', 'b\x1e': 'y\x81', 'b\x1f': 'y\x82', 'b\x18': 'c', 'b\x19': 'd', 'b\x1a': 'e', 'b\x1b': 'x\x81', '`\x02': 'Pic3', '\xc4': 'cos(', '\xef\x0c': 'getDtFmt', 'O': 'O', '\xd4': 'End', '\xd9': 'Stop', '_': 'prgm', '\xe4': 'SortD(', 'o': '\xf8', '\xbb[': 'NormProbPlot', '\xf4': 'LinReg(a+bx) ', '\x7f': '\xd0', '\x85': 'ClrDraw', '\n': '\xf5', '\xbbl': 'AsmPrgm', '\x95': ' nCr ', '\x1a': 'min(', 'b!': '\xd6', '\xef\t': 'getDate', '\xda': 'IS>(', '\xa5': 'Circle(', '*': '"', '\xb5': 'dim(', ':': '.', '\xc5': 'cos\xf1(', 'J': 'J', '\xbbK': 'Pmt_End', '\xd5': 'Return', 'b*': '\xea\x82', 'a\x05': 'GDB6', 'Z': 'Z', '\xef\x07': 'getDtStr(', '\xe5': 'DispTable', 'j': '=', '\xf5': 'ExpReg ', '}': 'DependAsk', 'z': 'IndpntAuto', '\x94': ' nPr ', '\x05': 'Boxplot', '\x8a': 'Zoom Out', '\x15': 'rowSwap(', '\x9a': 'StoreGDB ', '%': 'nDeriv(', '\xc9': 'sinh\xf1(', '\xf2': '1-VarStats ', '5': '5', '\xbb:': 'List\xe5matr(', '\xba': 'fPart(', 'E': 'E', '\xca': 'cosh(', 'U': 'U', '\xbb<': 'T-Test ', '\xa4': 'Shade(', 'a\x01': 'GDB2', 'a\x00': 'GDB1', 'a\x03': 'GDB4', 'a\x02': 'GDB3', 'e': 'Degree', 'a\x04': 'GDB5', 'a\x07': 'GDB8', 'a\x06': 'GDB7', 'a\t': 'GDB0', 'a\x08': 'GDB9', '\xea': 'PlotsOff ', 'u': 'Full', '\xfa': 'ClrList '}


(P.S. This may not work for the Financial operators. It took me SEVERAL HOURS to type all of those characters, and the Finance tokens would double that time.) However, it seems I need to remake this list for use with unicode fonts...


EDIT: spoilered for longness. The code is also broken. See below.
Last edited by darkspork on Sun Apr 05, 2009 12:32 pm UTC, edited 1 time in total.
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby Amnesiasoft » Sat Mar 28, 2009 8:09 am UTC

Last time I used TI Connect for Windows it had a program editor, and an emulator* (though it required you to dump a ROM from your calculator first though). Is there a reason to even do all this work yourself?

* Not sure if that came with TI Connect, but I did have one.
User avatar
Amnesiasoft
 
Posts: 2575
Joined: Tue May 15, 2007 4:28 am UTC
Location: Colorado

Re: TI-84 Plus programming

Postby Ventanator » Sat Mar 28, 2009 4:52 pm UTC

It doesn't come with a program editor or an emulator - it does have a data editor however, which may be what you are thinking of. It doesn't allow you to create and/or edit programs like his software does though.
User avatar
Ventanator
 
Posts: 158
Joined: Thu Mar 26, 2009 10:22 pm UTC

Re: TI-84 Plus programming

Postby Amnesiasoft » Mon Mar 30, 2009 2:58 am UTC

Ah, I know why, I was using the predecessor, TI Graph Link. Which does have a program editor in it. But I guess since that software is long dead it may or may not work with the 84, or any operating system that isn't DOS based.

If you're brave, you can try it out!
User avatar
Amnesiasoft
 
Posts: 2575
Joined: Tue May 15, 2007 4:28 am UTC
Location: Colorado

Re: TI-84 Plus programming

Postby darkspork » Fri Apr 03, 2009 11:30 pm UTC

I'm almost done with my Python rewrite. I had to remake most of it from the specialized Texas Instruments version of ASCII to the official one. I also added help commands. I need some help, though. If anyone who knows statistics could provide any sort of help (or perhaps the proper English equivalents) for these tokens, I would greatly appreciate it. This is a list of tuples in Python. The first string is the token, the second is its English version, and the third is its help string. A list of what these are actually supposed to represent can be found here

Spoiler:
Code: Select all
def stat():
    return [
        ('\x1b', 'R>Pr(', ''),
        ('\x1c', 'R>Ptheta', ''),
        ('\x1d', 'P>Rx(', ''),
        ('\x1e', 'P>Ry', ''),
        ('b\x01', 'RegEq', ''),
        ('b\x02', 'n', ''),
        ('b\x03', 'xbar', ''),
        ('b\x04', 'sumx', ''),
        ('b\x05', 'sumx^2', ''),
        ('b\x06', 'Sx', ''),
        ('b\x07', 'sigmax', ''),
        ('b\x08', 'minX', ''),
        ('b\t', 'maxX', ''),
        ('b\n', 'minY', ''),
        ('b\x0b', 'maxY', ''),
        ('b\x0c', 'ybar', ''),
        ('b\r', 'sumy', ''),
        ('b\x0e', 'sumy^2', ''),
        ('b\x0f', 'Sy', ''),
        ('b\x10', 'sigmay', ''),
        ('b\x11', 'sumxy', ''),
        ('b\x12', 'r', ''),
        ('b\x13', 'Med', ''),
        ('b\x14', 'Q1', ''),
        ('b\x15', 'Q3', ''),
        ('b\x16', 'a', ''),
        ('b\x17', 'b', ''),
        ('b\x18', 'c', ''),
        ('b\x19', 'd', ''),
        ('b\x1a', 'e', ''),
        ('b\x1b', 'x1', ''),
        ('b\x1c', 'x2', ''),
        ('b\x1d', 'x3', ''),
        ('b\x1e', 'y1', ''),
        ('b\x1f', 'y2', ''),
        ('b ', 'y3', ''),
        ('b!', 'eta', 'The Greek letter eta'),
        ('b"', 'p', 'p'),
        ('b#', 'z', 'z'),
        ('b$', 't', 't'),
        ('b%', 'X^2', 'X^2'),
        ('b&', 'F', 'F        (Statistics)'),
        ("b'", 'df', ''),
        ('b(', 'pcarat', ''),
        ('b)', 'pcarat1', ''),
        ('b*', 'pcarat2', ''),
        ('b+', 'xbar1', ''),
        ('b,', 'Sx1', ''),
        ('b-', 'n1', ''),
        ('b.', 'xbar2', ''),
        ('b/', 'Sx2', ''),
        ('b0', 'n2', ''),
        ('b1', 'Sxp', ''),
        ('b2', 'lower', ''),
        ('b3', 'upper', ''),
        ('b4', 's', 's'),
        ('b5', 'r^2', ''),
        ('b6', 'R^2', ''),
        ('b7', 'Factordf', ''),
        ('b8', 'FactorSS', ''),
        ('b9', 'FactorMS', ''),
        ('b:', 'Errordf', ''),
        ('b;', 'ErrorSS', ''),
        ('b<', 'ErrorMS', ''),
        ('\xbb\x10', 'normalcdf(', ''),
        ('\xbb\x11', 'invNorm(', ''),
        ('\xbb\x12', 'tcdf(', ''),
        ('\xbb\x13', '&X^2cdf(', ''),
        ('\xbb\x14', '&Fcdf(', ''),
        ('\xbb\x15', 'binompdf(', ''),
        ('\xbb\x16', 'binomcdf(', ''),
        ('\xbb\x17', 'poissonpdf(', ''),
        ('\xbb\x18', 'poissoncdf(', ''),
        ('\xbb\x19', 'geometpdf(', ''),
        ('\xbb\x1a', 'geometcdf(', ''),
        ('\xbb\x1b', 'normalpdf(', ''),
        ('\xbb\x1c', 'tpdf(', ''),
        ('\xbb\x1d', '&X^2pdf(', ''),
        ('\xbb\x1e', '&Fpdf(', ''),
        ('\xbb\x1f', 'randNorm(', ''),
        ('\xbb2', 'SinReg ', ''),
        ('\xbb3', 'Logistic ', ''),
        ('\xbb4', 'LinRegTTest ', ''),
        ('\xbb5', 'ShadeNorm(', ''),
        ('\xbb6', 'Shade_t(', ''),
        ('\xbb7', 'ShadeX^2', ''),
        ('\xbb8', 'ShadeF(', ''),
        ('\xbb9', 'Matr>list(', ''),
        ('\xbb:', 'List>matr(', ''),
        ('\xbb;', 'Z-Test(', ''),
        ('\xbb<', 'T-Test ', ''),
        ('\xbb=', '2-SampZTest(', ''),
        ('\xbb>', '1-PropZTest(', ''),
        ('\xbb?', '2-PropZTest(', ''),
        ('\xbb@', '&X^2-Test(', ''),
        ('\xbbA', 'ZInterval ', ''),
        ('\xbbB', '2-SampZInt(', ''),
        ('\xbbC', '1-PropZInt(', ''),
        ('\xbbD', '2-PropZInt(', ''),
        ('\xbbF', '2-SampTTest ', ''),
        ('\xbbG', '2-SampFTest ', ''),
        ('\xbbH', 'TInterval ', ''),
        ('\xbbI', '2-SampTInt ', ''),
        ('\xbbJ', 'SetUpEditor ', ''),
        ('\xbbK', 'Pmt_End', ''),
        ('\xbbL', 'Pmt_Bgn', ''),
        ('\xbbX', 'Select(', ''),
        ('\xbbY', 'ANOVA(', ''),
        ('\xbbZ', 'ModBoxplot', ''),
        ('\xbb[', 'NormProbPlot', ''),
        ('\xbb\xad', '&^p', ''),
        ('\xbb\xae', '&chi', 'The Greek letter Chi'),
        ('\xbb\xaf', '&F', '')]

Oh, and don't worry about compatibility issues with other token groups. All of these will automatically have the prefix '&stat' to differentiate the Statistics F (&statF) from the variable letter F (F).
Last edited by darkspork on Sun Apr 05, 2009 12:31 pm UTC, edited 1 time in total.
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs

Re: TI-84 Plus programming

Postby darkspork » Sun Apr 05, 2009 12:30 pm UTC

Double post, but worth it. I give you Python:

dict_source.py
Code: Select all
def index():
    return ('stat', 'finance', 'ti84plus')

def base():
    return [
        ('', '&null', 'Use &null to tell the compiler to break up the next statement'),
        ('\x01', '>DMS', 'Angle>DMS        (Displays Angle in degrees/minutes/seconds format)'),
        ('\x02', '>DEC', 'Value>DEC (Displays Value in decimal format)'),
        ('\x03', '>FRAC', 'Value>FRAC (Displays Value as a Fraction in simplest terms)'),
        ('\x04', '->', 'Value->Variable (Assigns Value to Variable)'),
        ('\x05', 'Boxplot', ''),
        ('\x06', '[', ''),
        ('\x07', ']', ''),
        ('\x08', '{', ''),
        ('\x09', '}', ''),
        ('\x0a', '&rad', 'Angle&rad (Interprets Angle in radians)'),
        ('\x0b', '&deg', 'Angle&deg (Interprets Angle in degrees)'),
        ('\x0c', '&^-1', 'Value^-1 (Returns the inverse of Value)'),
        ('\x0d', '&^2', 'Value^2 (Returns Value squared)'),
        ('\x0e', '&transpose', 'Matrix&transpose (Transpose: Returns (row,column)¸(column,row))'),
        ('\x0f', '&^3', 'Value^3 (Returns Value cubed)'),
        ('\x10', '(', ''),
        ('\x11', ')', ''),
        ('\x12', 'round(', 'round(Value[,#Decimals]) (Returns Value rounded to #Decimals. Default=0)'),
        ('\x13', 'pxl-Test(', 'pxl-Test(Row,Column) (Returns 1 if pixel is On, 0 if pixel is Off)'),
        ('\x14', 'augment(', 'augment(ListA,ListB) (Returns ListB Concatenated to the end of ListA)'),
        ('\x15', 'rowSwap(', 'rowSwap(Matrix,RowA,RowB) (Returns RowA swapped with RowB)'),
        ('\x16', 'row+(', 'row+(Matrix,RowA,RowB) (Returns RowA added to RowB, stored in RowB'),
        ('\x17', '*row(', '*row(Value,Matrix,Row) (Returns Row multiplied by Value, stored in Row)'),
        ('\x18', '*row+(', '*row+(Value,Matrix,RowA,RowB) (Returns RowA*Value+RowB, stored in RowB)'),
        ('\x19', 'max(', 'max(ValueA,ValueB) max(List) max(ListA,ListB) max(Value,List) (Rtn high val of each pair)'),
        ('\x1a', 'min(', 'min(ValueA,ValueB) min(List) min(ListA,ListB) min(Value,List) (Rtn low val of each pair)'),
        ('\x1f', 'median(', 'median(List[,Freqlist]) (Returns median of List with frequency Freqlist)'),
        (' ', 'randM(', 'randM(Rows,Columns) (Returns a random matrix of the dimension (Rows * Columns))'),
        ('!', 'mean(', 'mean(List[,Freqlist]) (Returns mean of List with frequency Freqlist)'),
        ('"', 'solve(', 'solve(Expression,Variable,Guess,{Lower,Upper}) (Solves Expression for Variable)'),
        ('#', 'seq(', 'seq(Expression,Variable,Begin,End[,Increment]) (Returns list of solutions)'),
        ('$', 'fnInt(', 'fnInt(Expression,Variable,Lower,Upper[,Tolerance]) (Returns integral of Expression)'),
        ('%', 'nDeriv(', 'nDeriv(Expression,Variable,Value[,h]) (Returns approx num deriv of Expr w/ Variable at Value)'),
        ("'", 'fMin(', 'fMin(Expression,Variable,Lower,Upper[,Tolerance]) (Returns minimum value of Expression)'),
        ('(', 'fMax(', 'fMax(Expression,Variable,Lower,Upper[,Tolerance]) (Returns maximum value of Expression)'),
        (')', ' ', ''),
        ('*', '"', '"Textstring" (Returns a string containing Textstring)'),
        ('+', ',', ''),
        (',', '&i', 'i (imaginary i=(-1)^(1/2))'),
        ('-', '!', 'Value! (factorial (Value!)=(Value-1)!*Value)'),
        ('0', '0', ''),
        ('1', '1', ''),
        ('2', '2', ''),
        ('3', '3', ''),
        ('4', '4', ''),
        ('5', '5', ''),
        ('6', '6', ''),
        ('7', '7', ''),
        ('8', '8', ''),
        ('9', '9', ''),
        (':', '.', ''),
        (';', '&E', 'Value&EPower (Used in scientific notation. Same as Value*10^Power)'),
        ('<', ' or ', 'ValueA or ValueB (Logical OR operator)'),
        ('=', ' xor ', 'ValueA or ValueB (Logical XOR operator, same as (A OR B) AND NOT (A AND B))'),
        ('>', ':', ''),
        ('?', '\n', ''),
        # All hail the Almighty Microsoft,
        # who insist on using linefeed AND carrage return.
        # The \r\n will be used, because Macs and most
        # Linux distros seem capable of using it.
        # Comment the following line out if you don't
        # want the program to do that.
        ('?', '\r\n', ''),
        ('@', ' and ', 'ValueA and ValueB (Logical AND operator)'),
        ('A', 'A', ''),
        ('B', 'B', ''),
        ('C', 'C', ''),
        ('D', 'D', ''),
        ('E', 'E', ''),
        ('F', 'F', ''),
        ('G', 'G', ''),
        ('H', 'H', ''),
        ('I', 'I', ''),
        ('J', 'J', ''),
        ('K', 'K', ''),
        ('L', 'L', ''),
        ('M', 'M', ''),
        ('N', 'N', ''),
        ('O', 'O', ''),
        ('P', 'P', ''),
        ('Q', 'Q', ''),
        ('R', 'R', ''),
        ('S', 'S', ''),
        ('T', 'T', ''),
        ('U', 'U', ''),
        ('V', 'V', ''),
        ('W', 'W', ''),
        ('X', 'X', ''),
        ('Y', 'Y', ''),
        ('Z', 'Z', ''),
        ('[', '&theta', 'The Greek letter Theta'),
        ('\\\x00', '[A]', ''),
        ('\\\x01', '[B]', ''),
        ('\\\x02', '[C]', ''),
        ('\\\x03', '[D]', ''),
        ('\\\x04', '[E]', ''),
        ('\\\x05', '[F]', ''),
        ('\\\x06', '[G]', ''),
        ('\\\x07', '[H]', ''),
        ('\\\x08', '[I]', ''),
        ('\\\t', '[J]', ''),
        (']\x00', '&L1', ''),
        (']\x01', '&L2', ''),
        (']\x02', '&L3', ''),
        (']\x03', '&L4', ''),
        (']\x04', '&L5', ''),
        (']\x05', '&L6', ''),
        ('^\x10', '&Y1', ''),
        ('^\x11', '&Y2', ''),
        ('^\x12', '&Y3', ''),
        ('^\x13', '&Y4', ''),
        ('^\x14', '&Y5', ''),
        ('^\x15', '&Y6', ''),
        ('^\x16', '&Y7', ''),
        ('^\x17', '&Y8', ''),
        ('^\x18', '&Y9', ''),
        ('^\x19', '&Y0', ''),
        ('^ ', '&X1T', ''),
        ('^!', '&Y1T', ''),
        ('^"', '&X2T', ''),
        ('^#', '&Y2T', ''),
        ('^$', '&X3T', ''),
        ('^%', '&Y3T', ''),
        ('^&', '&X4T', ''),
        ("^'", '&Y4T', ''),
        ('^(', '&X5T', ''),
        ('^)', '&Y5T', ''),
        ('^*', '&X6T', ''),
        ('^+', '&Y6T', ''),
        ('^@', '&r1', ''),
        ('^A', '&r2', ''),
        ('^B', '&r3', ''),
        ('^C', '&r4', ''),
        ('^D', '&r5', ''),
        ('^E', '&r6', ''),
        ('^\x80', '&u', ''),
        ('^\x81', '&v', ''),
        ('^\x82', '&w', ''),
        ('_', 'prgm', ''),
        ('`\x00', 'Pic1', ''),
        ('`\x01', 'Pic2', ''),
        ('`\x02', 'Pic3', ''),
        ('`\x03', 'Pic4', ''),
        ('`\x04', 'Pic5', ''),
        ('`\x05', 'Pic6', ''),
        ('`\x06', 'Pic7', ''),
        ('`\x07', 'Pic8', ''),
        ('`\x08', 'Pic9', ''),
        ('`\t', 'Pic0', ''),
        ('a\x00', 'GDB1', ''),
        ('a\x01', 'GDB2', ''),
        ('a\x02', 'GDB3', ''),
        ('a\x03', 'GDB4', ''),
        ('a\x04', 'GDB5', ''),
        ('a\x05', 'GDB6', ''),
        ('a\x06', 'GDB7', ''),
        ('a\x07', 'GDB8', ''),
        ('a\x08', 'GDB9', ''),
        ('a\t', 'GDB0', ''),
        ('b!', '&eta', 'The Greek letter eta'),
        ('d', 'Radian', 'Set Radian mode'),
        ('e', 'Degree', 'Set Degree mode'),
        ('f', 'Normal', 'Normal notation'),
        ('g', 'Sci', 'Scientific notation'),
        ('h', 'Eng', 'Engineering notation'),
        ('i', 'Float', 'Floating Point notation'),
        ('j', '=', 'Test for equality'),
        ('k', '<', 'Is less than'),
        ('l', '>', 'Is greater than'),
        ('m', '<=', 'Is less than or equal to'),
        ('n', '>=', 'Is greater than or equal to'),
        ('o', '!=', 'Is not equal to'),
        ('p', '+', ''),
        ('q', '-', ''),
        ('r', 'Ans', '(Returns the previous answer)'),
        ('s', 'Fix', 'Fix # (Sets fixed decimal notation to # places)'),
        ('t', 'Horiz', 'Horiz (Horizontal split-screen mode)'),
        ('u', 'Full', 'Full (Sets Fullscreen mode)'),
        ('v', 'Func', 'Func (Sets Function graphing mode)'),
        ('w', 'Param', 'Param (Sets Parametric graphing mode)'),
        ('x', 'Polar', 'Polar (Sets Polar graphing mode)'),
        ('y', 'Seq', 'Seq (Sets Sequence graphing mode)'),
        ('z', 'IndpntAuto', ''),
        ('{', 'IndpntAsk', ''),
        ('|', 'DependAuto', ''),
        ('}', 'DependAsk', ''),
        ('~\x00', 'Sequential', 'Sequential (Draw graphs one at a time)'),
        ('~\x01', 'Simul', 'Simul (Draw graphs simultaneously)'),
        ('~\x02', 'PolarGC', ''),
        ('~\x03', 'RectGC', ''),
        ('~\x04', 'CoordOn', ''),
        ('~\x05', 'CoordOff', ''),
        ('~\x06', 'Connected', '(Connect points on graph)'),
        ('~\x07', 'Dot', '(Don\'t connect points on graph)'),
        ('~\x08', 'AxesOn', '(Display axes on graph)'),
        ('~\t', 'AxesOff', '(Don\'t display axes on graph)'),
        ('~\n', 'GridOn', '(Display the grid)'),
        ('~\x0b', 'GridOff', '(Don\'t display the grid)'),
        ('~\x0c', 'LabelOn', '(Label the graphs)'),
        ('~\r', 'LabelOff', '(Don\'t label the graphs)'),
        ('~\x0e', 'Web', '(Draw seuence graphs as webs)'),
        ('~\x0f', 'Time', '(Draw sequence graphs over time)'),
        ('~\x10', 'uvAxes', ''),
        ('~\x11', 'uwAxes', ''),
        ('~\x12', 'vwAxes', ''),
        ('\x7f', '&square', 'Square mark'),
        ('\x80', '&plus', 'Plus mark'),
        ('\x81', '&dot', 'Dot mark'),
        ('\x82', '*', ''),
        ('\x83', '/', ''),
        ('\x84', 'Trace', ''),
        ('\x85', 'ClrDraw', '(Clear the graph window)'),
        ('\x86', 'ZStandard', '(Standard zoom)'),
        ('\x87', 'ZTrig', '(Trig zoom)'),
        ('\x88', 'ZBox', ''),
        ('\x89', 'Zoom In', ''),
        ('\x8a', 'Zoom Out', ''),
        ('\x8b', 'ZSquare', '(Zoom to give each pixel has an equal height and width)'),
        ('\x8c', 'ZInteger', '(Zoom to give each pixel a height and width of 1)'),
        ('\x8d', 'ZPrevious', ''),
        ('\x8e', 'ZDecimal', '(Zoom to give each pixel a height and width of 0.1)'),
        ('\x8f', 'ZoomStat', ''),
        ('\x90', 'ZoomRcl', ''),
        ('\x92', 'ZoomSto', ''),
        ('\x93', 'Text(', 'Text(Row,Column,Text1[,Text2,..,Textn]) (Draws text on the graph)'),
        ('\x94', ' nPr ', ''),
        ('\x95', ' nCr ', ''),
        ('\x96', 'FnOn ', 'FnOn [Function#,Function#...] (Enables all [specified] functions)'),
        ('\x97', 'FnOff ', 'FnOff [Function#,Function#...] (Disables all [specified] functions)'),
        ('\x98', 'StorePic ', 'StorePic # (Stores a screenshot in Pic#)'),
        ('\x99', 'RecallPic ', 'RecallPic # (Displays the screenshot stored in Pic#)'),
        ('\x9a', 'StoreGDB ', ''),
        ('\x9b', 'RecallGDB ', ''),
        ('\x9c', 'Line(', 'Line(X1,Y1,X2,Y2[,0]) (Draws a line from (X1,Y1) to (X2,Y2) on the graph. Add 0 to erase.)'),
        ('\x9d', 'Vertical ', 'Vertical x (Draws a vertical line at x)'),
        ('\x9e', 'Pt-On(', 'Pt-On(x,y[,mark]) (Draws a point at (x,y) with mark)'),
        ('\x9f', 'Pt-Off(', 'Pt-Off(x,y[,mark]) (Erases a point at (x,y) with mark)'),
        ('\xa0', 'Pt-Change(', 'Pt-Change(x,y) (Toggles the point at (x,y))'),
        ('\xa1', 'Pxl-On(', 'Pxl-On(Row,Column) (Draws the pixel at (Row,Column))'),
        ('\xa2', 'Pxl-Off(', 'Pxl-Off(Row,Column) (Erases the pixel at (Row,Column))'),
        ('\xa3', 'Pxl-Change(', 'Pxl-Change(Row,Column) (Toggles the pixel at (Row,Column))'),
        ('\xa4', 'Shade(', 'Shade(Lowerfunc,Upperfunc[,Xleft,Xright,Pattern,Patres]) (See manual for details)'),
        ('\xa5', 'Circle(', 'Circle(x,y,r) (Draws a circle with center (x,y) and radius r)'),
        ('\xa6', 'Horizontal ', 'Horizontal y (Draws a horizontal line at y)'),
        ('\xa7', 'Tangent(', 'Tangent(Expression,Value) (Draws a line tangent to Expression at Value)'),
        ('\xa8', 'DrawInv ', 'DrawInv Expression (Plots the inverse of Expression by plotting X values on the Y axis)'),
        ('\xa9', 'DrawF ', 'DrawF Expression (Plots Expression)'),
        ('\xaa\x00', 'Str1', ''),
        ('\xaa\x01', 'Str2', ''),
        ('\xaa\x02', 'Str3', ''),
        ('\xaa\x03', 'Str4', ''),
        ('\xaa\x04', 'Str5', ''),
        ('\xaa\x05', 'Str6', ''),
        ('\xaa\x06', 'Str7', ''),
        ('\xaa\x07', 'Str8', ''),
        ('\xaa\x08', 'Str9', ''),
        ('\xaa\t', 'Str0', ''),
        ('\xab', 'rand', 'rand[(Numtrials)] (Returns a random number from 0 to 1)'),
        ('\xac', '&pi', 'The Greek letter pi is approximated at 3.1415926545898'),
        ('\xad', 'getKey', 'getKey (Returns the last key pressed or 0 for no key. See Tools>Button List for details.)'),
        ('\xae', "'", ''),
        ('\xaf', '?', ''),
        ('\xb0', '&-', 'The negative sign. This is a different key from subtraction!'),
        ('\xb1', 'int(', 'int(Value) (Returns the largest integer ˜ Value)'),
        ('\xb2', 'abs(', 'abs(Value) (Returns the absolute value of Value)'),
        ('\xb3', 'det(', 'det(Matrix) (Returns the Determinant of Matrix)'),
        ('\xb4', 'identity(', 'identity(Dimension) (Returns the identity matrix of Dimension rows and columns)'),
        ('\xb5', 'dim(', 'Length¸dim(List) {Rows,Columns}¸dim(Matrix) (Gives List/Matrix the specified dimension(s))'),
        ('\xb6', 'sum(', 'sum(List[,Start,End]) (Returns the sum of values in List from Start to End)'),
        ('\xb7', 'prod(', 'prod(List[,Start,End]) (Returns the product of values in List from Start to End)'),
        ('\xb8', 'not(', 'not(Value) (If Value>0, returns 0. If Value=0, returns 1)'),
        ('\xb9', 'iPart(', 'iPart(Value) (Returns the integer part of a number)'),
        ('\xba', 'fPart(', 'fPart(Value) (Returns the fraction part of a number)'),
        ('\xbb\x07', 'dbd(', 'dbd(DDMM.YY, DDMM.YY) (Returns the number of days between two dates)'),
        ('\xbb\x08', 'lcm(', 'lcm(ValueA,ValueB) (Returns the least common multiple of ValueA and ValueB)'),
        ('\xbb\t', 'gcd(', 'gcd(ValueA,ValueB) (Returns the greatest common factor of ValueA and ValueB)'),
        ('\xbb\n', 'randInt(', 'randInt(Lower,Upper[,numtrials]) (Returns a random integer between Lower and Upper'),
        ('\xbb\x0b', 'randBin(', ''),
        ('\xbb\x0c', 'sub(', 'sub(String,Begin,Length) (Returns part of String starting at Begin of length Length)'),
        ('\xbb\r', 'stdDev(', 'stdDev(List[,Freqlist]) (Returns the standard derivation of the elements in List)'),
        ('\xbb\x0e', 'variance(', 'variance(List[,Freqlist]) (Returns the variance of the elements in List)'),
        ('\xbb\x0f', 'inString(', 'inString(String,Find[,Start]) (Returns position of the first instance of Find in String)'),
        ('\xbb%', 'conj(', 'conj(Value) (Returns the complex conjugate of Value)'),
        ('\xbb&', 'real(', 'real(Value) (Returns the real part of a complex number or numbers)'),
        ("\xbb'", 'imag(', 'imag(Value) (Returns the imaginary part of a complex number or numbers)'),
        ('\xbb(', 'angle(', 'angle(Value) (Returns the polar angle of a complex number or numbers)'),
        ('\xbb)', 'cumSum(', 'sumSum(List) (Returns a list of the cumulative sums of the elements in List)'),
        ('\xbb*', 'expr(', 'expr(String) (Converts String to an expression and executes it)'),
        ('\xbb+', 'length(', 'length(String) (Returns the number of characters in String)'),
        ('\xbb,', '&deltaList(', '&deltaList(List) (Returns the difference between consecutive terms in a list, as a list)'),
        ('\xbb-', 'ref(', 'ref(Matrix) (Returns the row-echelon form of Matrix)'),
        ('\xbb.', 'rref(', 'rref(Matrix) (Returns the reduced row-echelon form of Matrix)'),
        ('\xbb/', '>Rect', ''),
        ('\xbb0', '>Polar', ''),
        ('\xbb1', '&e', 'Euler\'s constant is approximated at 2.718281828459'),
        ('\xbbE', 'GraphStyle(', ''),
        ('\xbbM', 'Real', 'Real (Sets real number mode)'),
        ('\xbbN', '&re^thetai', '(Sets polar complex number mode)'),
        ('\xbbO', '&a+bi', '(Sets rectangular complex number mode)'),
        ('\xbbP', 'ExprOn', 'ExprOn (Turns on expression display during Trace)'),
        ('\xbbQ', 'ExprOff', 'ExprOff (Turns off expression display during Trace)'),
        ('\xbbR', 'ClrAllLists', 'ClrAllLists (Clears all lists from memory)'),
        ('\xbbS', 'GetCalc(', 'GetCalc(Variable[,Portflag]) (See the manual for details)'),
        ('\xbbT', 'DelVar ', 'DelVar Variable (Deletes Variable from memory)'),
        ('\xbbU', 'Equ>String(', 'Equ>String(Yvar,Str#) (Converts Yvar into a string and stores it in Str#)'),
        ('\xbbV', 'String>Equ(', 'String>Equ(String,Yvar) (Converts String to an expression and stores it in Yvar)'),
        ('\xbbW', 'Clear Entries', 'Clear Entries (Clears the Last Entry storage area)'),
        ('\xbbd', '&G-T', 'G-T (Sets graph-table vertical split screen mode)'),
        ('\xbbe', 'ZoomFit', 'ZoomFit (Zooms the graph to include all minimums and maximums'),
        ('\xbbf', 'DiagnosticOn', ''),
        ('\xbbg', 'DiagnosticOff', ''),
        ('\xbbh', 'Archive ', 'Archive Variable (Stores Variable in flash memory)'),
        ('\xbbi', 'UnArchive ', 'UnArchive  Variable (Stores Variable in RAM memory)'),
        ('\xbbj', 'Asm(', 'Asm(Program) (Executes an assembly-language program)'),
        ('\xbbk', 'AsmComp(', 'AsmComp(Asciiprogram,Hexprogram) (Compiles an Ascii asm program, stores it in Hexprogram)'),
        ('\xbbl', 'AsmPrgm', 'AsmPrgm (Use this at the heading of an assembly-language program)'),
        ('\xbbm', 'compiled asm', ''),
        ('\xbbn', 'Á', ''),
        ('\xbbo', 'À', ''),
        ('\xbbp', 'Â', ''),
        ('\xbbq', 'Ä', ''),
        ('\xbbr', 'á', ''),
        ('\xbbs', 'à', ''),
        ('\xbbt', 'â', ''),
        ('\xbbu', 'ä', ''),
        ('\xbbv', 'É', ''),
        ('\xbbw', 'È', ''),
        ('\xbbx', 'Ê', ''),
        ('\xbby', 'Ë', ''),
        ('\xbbz', 'é', ''),
        ('\xbb{', 'è', ''),
        ('\xbb|', 'ê', ''),
        ('\xbb}', 'ë', ''),
        ('\xbb\x7f', 'Ì', ''),
        ('\xbb\x80', 'Î', ''),
        ('\xbb\x81', 'Ï', ''),
        ('\xbb\x82', 'í', ''),
        ('\xbb\x83', 'ì', ''),
        ('\xbb\x84', 'î', ''),
        ('\xbb\x85', 'ï', ''),
        ('\xbb\x86', 'Ó', ''),
        ('\xbb\x87', 'Ò', ''),
        ('\xbb\x88', 'Ô', ''),
        ('\xbb\x89', 'Ö', ''),
        ('\xbb\x8a', 'ó', ''),
        ('\xbb\x8b', 'ò', ''),
        ('\xbb\x8c', 'ô', ''),
        ('\xbb\x8d', 'ö', ''),
        ('\xbb\x8e', 'Ú', ''),
        ('\xbb\x8f', 'Ù', ''),
        ('\xbb\x90', 'Û', ''),
        ('\xbb\x91', 'Ü', ''),
        ('\xbb\x92', 'ú', ''),
        ('\xbb\x93', 'ù', ''),
        ('\xbb\x94', 'û', ''),
        ('\xbb\x95', 'ü', ''),
        ('\xbb\x96', 'Ç', ''),
        ('\xbb\x97', 'ç', ''),
        ('\xbb\x98', 'Ñ', ''),
        ('\xbb\x99', 'ñ', ''),
        ('\xbb\x9a', '´', ''),
        ('\xbb\x9b', '`', ''),
        ('\xbb\x9c', '&"', 'An extra doublequote for some reason'),
        ('\xbb\x9d', '&?', 'The upside down question mark'),
        ('\xbb\x9e', '&!', 'The upside down exclamation point'),
        ('\xbb\x9f', '&alpha', 'The Greek letter Alpha'),
        ('\xbb\xa0', '&beta', 'The Greek letter Beta'),
        ('\xbb\xa1', '&gamma', 'The Greek letter Gamma'),
        ('\xbb\xa2', '&delta', 'The Greek letter Delta'),
        ('\xbb\xa3', '&ldelta', 'The Greek letter Delta (lowercase)'),
        ('\xbb\xa4', '&epsilon', 'The Greek letter Epsilon'),
        ('\xbb\xa5', '&lambda', 'The Greek letter Lambda'),
        ('\xbb\xa6', '&mu', 'The Greek letter Mu'),
        ('\xbb\xa7', '&xpi', 'For some reason, Pi has two characters'),
        ('\xbb\xa8', '&rho', 'The Greek letter Rho'),
        ('\xbb\xa9', '&sigma', 'The Greek letter Sigma'),
        ('\xbb\xab', '&phi', 'The Greek letter Phi'),
        ('\xbb\xac', '&omega', 'The Greek letter Omega'),
        ('\xbb\xae', '&chi', 'The Greek letter Chi'),
        ('\xbb\xb0', 'a', ''),
        ('\xbb\xb1', 'b', ''),
        ('\xbb\xb2', 'c', ''),
        ('\xbb\xb3', 'd', ''),
        ('\xbb\xb4', 'e', ''),
        ('\xbb\xb5', 'f', ''),
        ('\xbb\xb6', 'g', ''),
        ('\xbb\xb7', 'h', ''),
        ('\xbb\xb8', 'i', ''),
        ('\xbb\xb9', 'j', ''),
        ('\xbb\xba', 'k', ''),
        ('\xbb\xbc', 'l', ''),
        ('\xbb\xbd', 'm', ''),
        ('\xbb\xbf', 'o', ''),
        ('\xbb\xc1', 'q', ''),
        ('\xbb\xc2', 'r', ''),
        ('\xbb\xc8', 'x', ''),
        ('\xbb\xc9', 'y', ''),
        ('\xbb\xca', 'z', ''),
        ('\xbb\xcb', '&lsigma', 'The Greek letter Sigma (lowercase)'),
        ('\xbb\xcc', '&smallT1', ''),
        ('\xbb\xcd', 'Í', ''),
        ('\xbb\xce', 'GarbageCollect', 'Defragment, clean up memory'),
        ('\xbb\xcf', '~', ''),
        ('\xbb\xd1', '@', ''),
        ('\xbb\xd2', '#', ''),
        ('\xbb\xd3', '$', ''),
        ('\xbb\xd4', '&&', 'The ampersand must be escaped, as it is the escape character'),
        ('\xbb\xd5', '`', ''),
        ('\xbb\xd6', ';', ''),
        ('\xbb\xd7', '\\', ''),
        ('\xbb\xd8', '|', ''),
        ('\xbb\xd9', '_', ''),
        ('\xbb\xda', '%', 'Number% (Converts number to a percentage. NOT MODULUS OPERATOR)'),
        ('\xbb\xdb', '&...', 'Elipsis'),
        ('\xbb\xdc', '&angle', 'Angle symbol'),
        ('\xbb\xdd', '&beta', 'The Greek letter Beta'),
        ('\xbb\xde', '&smallx1', ''),
        ('\xbb\xdf', '&smallT2', ''),
        ('\xbb\xe0', '&small0', ''),
        ('\xbb\xe1', '&small1', ''),
        ('\xbb\xe2', '&small2', ''),
        ('\xbb\xe3', '&small3', ''),
        ('\xbb\xe4', '&small4', ''),
        ('\xbb\xe5', '&small5', ''),
        ('\xbb\xe6', '&small6', ''),
        ('\xbb\xe7', '&small7', ''),
        ('\xbb\xe8', '&small8', ''),
        ('\xbb\xe9', '&small9', ''),
        ('\xbb\xea', '&small10', ''),
        ('\xbb\xeb', '&leftarrow', ''),
        ('\xbb\xec', '&rightarrow', ''),
        ('\xbb\xed', '&uparrowsmall', ''),
        ('\xbb\xee', '&downarrowsmall', ''),
        ('\xbb\xef', '&smallx2', ''),
        ('\xbb\xf0', '&integral', 'The Integral symbol'),
        ('\xbb\xf1', '&uparrow', ''),
        ('\xbb\xf2', '&downarrow', ''),
        ('\xbb\xf3', '&squareroot', ''),
        ('\xbb\xf4', '&highlightedequals', 'A highlighted equals sign'),
        ('\xbc', '&squareroot(', '&squareroot(Value) (Returns the square root of Value)'),
        ('\xbd', '&cuberoot(', '&cuberoot(Value) (Returns the cube root of Value)'),
        ('\xbe', 'ln(', 'ln(Value) (Returns the natural logarithm of Value)'),
        ('\xbf', '&e^(', 'e^(Value) (Returns e to the power of Value)'),
        ('\xc0', 'log(', 'log(Value) (Returns the logarithm of Value)'),
        ('\xc1', '10^(', '10^(Value) (Returns 10 to the power of Value)'),
        ('\xc2', 'sin(', 'sin(Value) (Returns the sine of Value)'),
        ('\xc3', '&arcsin(', '&arcsin(Value) (Returns the arcsine of Value)'),
        ('\xc4', 'cos(', 'cos(Value) (Returns the cosine of Value)'),
        ('\xc5', '&arccos(', '&arccos(Value) (Returns the arccosine of Value)'),
        ('\xc6', 'tan(', 'tan(Value) (Returns the tangent of Value)'),
        ('\xc7', '&arctan(', '&arctan(Value) (Returns the arctangent of Value)'),
        ('\xc8', 'sinh(', 'sinh(Value) (Returns the hyperbolic sine of Value)'),
        ('\xc9', '&arcsinh(', '&arcsinh(Value) (Returns the hyperbolic arcsine of Value)'),
        ('\xca', 'cosh(', 'cosh(Value) (Returns the hyperbolic cosine of Value)'),
        ('\xcb', '&arccosh(', '&arccosh(Value) (Returns the hyperbolic arccosine of Value)'),
        ('\xcc', 'tanh(', 'tanh(Value) (Returns the hyperbolic tangent of Value)'),
        ('\xcd', '&arctanh(', '&arctanh(Value) (Returns the hyperbolic arctangent of Value)'),
        ('\xce', 'If ', 'If Condition:Command (If Condition=0, skips Command)'),
        ('\xcf', 'Then', 'If Condition:Then:Commands:Commands:End (If Condition=0, skips Commands)'),
        ('\xd0', 'Else', 'If Condition:Then:A:Else:B:End (If Condition=1, executes A. If Condition=0, executes B)'),
        ('\xd1', 'While ', 'While Condition:Commands:Commands:End (Executes Commands while Condition=True)'),
        ('\xd2', 'Repeat ', 'Repeat  Condition:Commands:Commands:End (Executes Commands until Condition=True)'),
        ('\xd3', 'For(', 'For(Variable,Begin,End[,Increment]):Commands:End (See manual for details)'),
        ('\xd4', 'End', 'End (See "For(", "If ", "Then", "Else", "While ", and "Repeat ")'),
        ('\xd5', 'Return', 'Return (Returns to the calling program)'),
        ('\xd6', 'Lbl ', 'Lbl Label (Creates a 1 or 2 letter label)'),
        ('\xd7', 'Goto ', 'Goto Label (Sends program execution to Label)'),
        ('\xd8', 'Pause ', 'Pause [Value] (Displays Value, suspends execution unitl the Enter key is pressed)'),
        ('\xd9', 'Stop', 'Stop (Ends program execution, returns to Home Screen)'),
        ('\xda', 'IS>(', 'IS>(Variable,Value):Command (Increments Variable by 1, skips Command if Variable>Value)'),
        ('\xdb', 'DS<(', 'DS<(Variable,Value):Command (Decrements Variable by 1, skips Command if Variable<Value)'),
        ('\xdc', 'Input ', 'Input ["Text",]Variable (Prompts for user to enter value, stores in Variable)'),
        ('\xdd', 'Prompt ', 'Prompt Variable[,Variable,Variable...] (Prompts user for variables in succession)'),
        ('\xde', 'Disp ', 'Disp Value[,Value,Value] (Displays each value as a new line on the home screen)'),
        ('\xdf', 'DispGraph', 'DispGraph (Displays the graph)'),
        ('\xe0', 'Output(', 'Output(Row,Column,Value) (Displays Value on the Home Screen starting at Row and Column)'),
        ('\xe1', 'ClrHome', 'ClrHome (Clears the Home Screen)'),
        ('\xe2', 'Fill(', 'Fill(Value,Matrix/List) (Fills Matrix/List with Value)'),
        ('\xe3', 'SortA(', 'SortA(List) (Sorts List elements in acending order)'),
        ('\xe4', 'SortD(', 'SortD(List) (Sorts List elements in decending order)'),
        ('\xe5', 'DispTable', 'DispTable (Displays the table)'),
        ('\xe6', 'Menu(', 'Menu("Title","Text1",Label1[,"Text2",Label2,...,"Text7",Label7]) (See Manual for details)'),
        ('\xe7', 'Send(', ''),
        ('\xe8', 'Get(', ''),
        ('\xeb', '&list', '&list (Identifies the next 1-5 characters as the name of a list)'),
        ('\xf0', '^', ''),
        ('\xf1', '&root', 'x&rooty (Returns y^(1/x))')]
def stat():
    return [
        ('.', 'CubicReg', ''),
        ('/', 'QuartReg', ''),
        ('\x1b', 'R>Pr(', ''),
        ('\x1c', 'R>Ptheta', ''),
        ('\x1d', 'P>Rx(', ''),
        ('\x1e', 'P>Ry', ''),
        ('b\x01', 'RegEq', ''),
        ('b\x02', 'n', ''),
        ('b\x03', 'xbar', ''),
        ('b\x04', 'sumx', ''),
        ('b\x05', 'sumx^2', ''),
        ('b\x06', 'Sx', ''),
        ('b\x07', 'sigmax', ''),
        ('b\x08', 'minX', ''),
        ('b\t', 'maxX', ''),
        ('b\n', 'minY', ''),
        ('b\x0b', 'maxY', ''),
        ('b\x0c', 'ybar', ''),
        ('b\r', 'sumy', ''),
        ('b\x0e', 'sumy^2', ''),
        ('b\x0f', 'Sy', ''),
        ('b\x10', 'sigmay', ''),
        ('b\x11', 'sumxy', ''),
        ('b\x12', 'r', ''),
        ('b\x13', 'Med', ''),
        ('b\x14', 'Q1', ''),
        ('b\x15', 'Q3', ''),
        ('b\x16', 'a', ''),
        ('b\x17', 'b', ''),
        ('b\x18', 'c', ''),
        ('b\x19', 'd', ''),
        ('b\x1a', 'e', ''),
        ('b\x1b', 'x1', ''),
        ('b\x1c', 'x2', ''),
        ('b\x1d', 'x3', ''),
        ('b\x1e', 'y1', ''),
        ('b\x1f', 'y2', ''),
        ('b ', 'y3', ''),
        ('b!', 'eta', 'The Greek letter eta'),
        ('b"', 'p', 'p'),
        ('b#', 'z', 'z'),
        ('b$', 't', 't'),
        ('b%', 'X^2', 'X^2'),
        ('b&', 'F', 'F        (Statistics)'),
        ("b'", 'df', ''),
        ('b(', 'pcarat', ''),
        ('b)', 'pcarat1', ''),
        ('b*', 'pcarat2', ''),
        ('b+', 'xbar1', ''),
        ('b,', 'Sx1', ''),
        ('b-', 'n1', ''),
        ('b.', 'xbar2', ''),
        ('b/', 'Sx2', ''),
        ('b0', 'n2', ''),
        ('b1', 'Sxp', ''),
        ('b2', 'lower', ''),
        ('b3', 'upper', ''),
        ('b4', 's', 's'),
        ('b5', 'r^2', ''),
        ('b6', 'R^2', ''),
        ('b7', 'Factordf', ''),
        ('b8', 'FactorSS', ''),
        ('b9', 'FactorMS', ''),
        ('b:', 'Errordf', ''),
        ('b;', 'ErrorSS', ''),
        ('b<', 'ErrorMS', ''),
        ('\xbb\x10', 'normalcdf(', ''),
        ('\xbb\x11', 'invNorm(', ''),
        ('\xbb\x12', 'tcdf(', ''),
        ('\xbb\x13', '&X^2cdf(', ''),
        ('\xbb\x14', '&Fcdf(', ''),
        ('\xbb\x15', 'binompdf(', ''),
        ('\xbb\x16', 'binomcdf(', ''),
        ('\xbb\x17', 'poissonpdf(', ''),
        ('\xbb\x18', 'poissoncdf(', ''),
        ('\xbb\x19', 'geometpdf(', ''),
        ('\xbb\x1a', 'geometcdf(', ''),
        ('\xbb\x1b', 'normalpdf(', ''),
        ('\xbb\x1c', 'tpdf(', ''),
        ('\xbb\x1d', '&X^2pdf(', ''),
        ('\xbb\x1e', '&Fpdf(', ''),
        ('\xbb\x1f', 'randNorm(', ''),
        ('\xbb2', 'SinReg ', ''),
        ('\xbb3', 'Logistic ', ''),
        ('\xbb4', 'LinRegTTest ', ''),
        ('\xbb5', 'ShadeNorm(', ''),
        ('\xbb6', 'Shade_t(', ''),
        ('\xbb7', 'ShadeX^2', ''),
        ('\xbb8', 'ShadeF(', ''),
        ('\xbb9', 'Matr>list(', ''),
        ('\xbb:', 'List>matr(', ''),
        ('\xbb;', 'Z-Test(', ''),
        ('\xbb<', 'T-Test ', ''),
        ('\xbb=', '2-SampZTest(', ''),
        ('\xbb>', '1-PropZTest(', ''),
        ('\xbb?', '2-PropZTest(', ''),
        ('\xbb@', '&X^2-Test(', ''),
        ('\xbbA', 'ZInterval ', ''),
        ('\xbbB', '2-SampZInt(', ''),
        ('\xbbC', '1-PropZInt(', ''),
        ('\xbbD', '2-PropZInt(', ''),
        ('\xbbF', '2-SampTTest ', ''),
        ('\xbbG', '2-SampFTest ', ''),
        ('\xbbH', 'TInterval ', ''),
        ('\xbbI', '2-SampTInt ', ''),
        ('\xbbJ', 'SetUpEditor ', ''),
        ('\xbbK', 'Pmt_End', ''),
        ('\xbbL', 'Pmt_Bgn', ''),
        ('\xbbX', 'Select(', ''),
        ('\xbbY', 'ANOVA(', ''),
        ('\xbbZ', 'ModBoxplot', ''),
        ('\xbb[', 'NormProbPlot', ''),
        ('\xbb\xad', '&^p', ''),
        ('\xbb\xae', '&chi', 'The Greek letter Chi'),
        ('\xbb\xaf', '&F', ''),
        ('\xe9', 'PlotsOn ', ''),
        ('\xea', 'PlotsOff ', ''),
        ('\xec', 'Plot1(', ''),
        ('\xed', 'Plot2(', ''),
        ('\xee', 'Plot3(', ''),
        ('\xf2', '1-VarStats ', ''),
        ('\xf3', '2-VarStats ', ''),
        ('\xf4', 'LinReg(a+bx) ', ''),
        ('\xf5', 'ExpReg ', ''),
        ('\xf6', 'LnReg ', ''),
        ('\xf7', 'PwrReg ', ''),
        ('\xf8', 'Med-Med ', ''),
        ('\xf9', 'QuadReg ', ''),
        ('\xfa', 'ClrList ', ''),
        ('\xfb', 'ClrTable', ''),
        ('\xfc', 'Histogram', ''),
        ('\xfd', 'xyLine', ''),
        ('\xfe', 'Scatter', ''),
        ('\xff', 'LinReg(ax+b) ', '')]
def finance():
    return [
        ('\xbb\x00', 'npv(', ''),
        ('\xbb\x01', 'irr(', ''),
        ('\xbb\x02', 'bal(', ''),
        ('\xbb\x03', 'sumprn(', ''),
        ('\xbb\x04', 'sumInt(', ''),
        ('\xbb\x05', '>Nom(', ''),
        ('\xbb\x06', '>Eff(', ''),
        ('\xbb ', 'tmv_Pmt', ''),
        ('\xbb!', 'tmv_I%', ''),
        ('\xbb"', 'tmv_PV', ''),
        ('\xbb#', 'tmv_N', ''),
        ('\xbb$', 'tmv_FV', '')]
def ti84plus():
    return [
        ('\xef\x00', 'setDate(', 'setDate(YYYY, MM, DD) (Sets the date)'),
        ('\xef\x01', 'setTime(', 'setTime(HH, MM, SS) (Sets the time in 24HR format)'),
        ('\xef\x02', 'checkTmr(', 'checkTmr(Variable) (Returns number of seconds since the timer stored in Variable)'),
        ('\xef\x03', 'setDtFmt(', 'setDtFmt(Format) (Set date display format: 1-M/D/Y 2-D/M/Y 3-Y/M/D)'),
        ('\xef\x04', 'setTmFmt(', 'setTmFmt(Format) (Set time display format: 12-12HR mode 24-24HR mode)'),
        ('\xef\x05', 'timeCnv(', 'timeCnv(Seconds) (Returns a list containing {D, H, M, S})'),
        ('\xef\x06', 'dayOfWk(', 'dayOfWk(YYYY, MM, DD) (Returns 1-7: 1=Sunday, 2=Monday, 3=Tuesday, etc...)'),
        ('\xef\x07', 'getDtStr(', 'getDtStr(Format) (Get a string representing the date. See setDtFmt for options.)'),
        ('\xef\x08', 'getTmStr(', 'getTmStr(Format) (Get a string representing the time. See setTmFmt for options.)'),
        ('\xef\x09', 'getDate', 'getDate (Returns a list containing {Y, M, D})'),
        ('\xef\x0a', 'getTime', 'getTime (Returns a list containing {H, M, S})'),
        ('\xef\x0b', 'startTmr', 'startTmr->Variable (Start a new timer, store in Variable. See "checkTmr(")'),
        ('\xef\x0c', 'getDtFmt', 'getDtFmt (Return the current date display format: 1-M/D/Y 2-D/M/Y 3-Y/M/D)'),
        ('\xef\x0d', 'getTmFmt', 'getTmFmt (Return the current time display format: 12-12HR mode 24-24HR mode)'),
        ('\xef\x0e', 'isClockOn', 'isClockOn (Returns 1 if clock is on)'),
        ('\xef\x0f', 'ClockOff', 'ClockOff (Disables the clock in the Mode screen)'),
        ('\xef\x10', 'ClockOn', 'ClockOn (Enables the clock in the Mode screen)'),
        ('\xef\x11', 'OpenLib(', ''),
        ('\xef\x12', 'ExecLib', ''),
        ('\xef\x13', 'invT(', ''),
        ('\xef\x14', 'X^2GOF-Test(', ''),
        ('\xef\x15', 'LinRegTInt', ''),
        ('\xef\x16', 'Manual-Fit', '')]

^^ This is a dictionary of (I think) all 648 TI Basic tokens. I don't think I missed any of the finance tokens, but feel free to check. The setup is easily modifiable - it's a list of tuples, each of which contains 3 items - the machine code, the translated code, and then a help string.

parse8xp.py
Code: Select all
import dict_source

__author__ = "Spork Interactive"
__version__ = "$Revision: 1.0 $"
__date__ = "$Date: 2009/03/27 $"
__copyright__ = "Copyright (c) 2009 Spork Interactive"
__license__ = "GNU"

def loadDict (dictType = "compile", options = dict_source.index()):
    ki=0 # ki is the key index
    vi=0 # vi is the value index
    (ki, vi) = {"compile":(1, 0), "decompile":(0, 1), "help":(1, 2)}[dictType]
    d = {}
    # load optional items first
    for item in options:
        # load each optional group
        try:
            m = [(t, "&%s%s" % (item, s.replace("&", "")), h) for (t, s, h) in getattr(dict_source, item)()]
            # We need to correct the dictionary.
            for li in m:
                d[li[ki]] = li[vi]
        except AttributeError:
            print "%s does not exist!" % item
    for li in dict_source.base():
        #Get the base values
        d[li[ki]] = li[vi]
    return d

def longestKey(dictionary):
    return max([len(k) for k, v in dictionary.items()])

def twoByte(number):
    return "%s%s" % (chr(number%256), chr((number//256)%256), )

def decompile(source8xp, destination):
    """Decompile a .8xp file, save that to destination file"""
    tDict = loadDict(dictType="decompile")
    maxKeyLen = longestKey(tDict)
    try:
        readFile=open(source8xp, "r")
        try:
            writeFile=open(destination, "w")
            try:
                # Load program name, protection type, and comment
                readFile.seek(11, 0)
                comment = readFile.read(42)
                readFile.seek(59, 0)
                protect = readFile.read(1) == "\x05" and "not " or ""
                name = readFile.read(8)
                writeFile.write("%s\n%sprotected\n%s\n" % (name, protect, comment))
                print "Loading %s..." % name
                print "Program is %sprotected" % protect
                print comment
                # Find data's end
                readFile.seek(-3, 2)
                fileLength = readFile.tell()
                # Read program meat
                readFile.seek(74, 0)
                while readFile.tell() <= fileLength: # Ignore the last 2 bytes (checksum)
                    readLen = 1 + fileLength - readFile.tell()
                    readLen = min([maxKeyLen, readLen])
                    current = readFile.read(readLen)
                      # Try each possible key for the next few characters
                    while (readLen > 1 and not tDict.has_key(current)):
                        readFile.seek(-1*readLen, 1)
                        readLen -= 1
                        current = readFile.read(readLen)
                    if tDict.has_key(current):
                        writeFile.write(tDict[current])
                        #print tDict[current]
                    else:
                        writeFile.write("&#%s" % current)
                        print "character %s not found!" % hex(ord(current))
                print "%s successfully decompiled as %s" % (source8xp, destination)
            except IOError:
                print "A file error occurred during translation"
            finally:
                writeFile.close()
        except IOError:
            print "Error creating %s!" % destination
        finally:
            readFile.close()
    except IOError:
        print "Error loading %s!" % source8xp

def recompile(source, destination8xp):
    """Open a text file, compile it as an 8xp.
    The first line should contain the 8 character program name,
    and the second should contain "protected" or "not protected",
    and the third should contain a 42 character comment."""
    tDict = loadDict(dictType="compile")
    maxKeyLen = longestKey(tDict)
    try:
        readFile=open(source, "r")
        try:
            writeFile=open(destination8xp, "w")
            try:
                # NOTE: we cannot simply write to file.
                # We have to find the checksum & other crap later
                writeBuffer = []
                # Learn program length
                readFile.seek(-1, 2)
                fileLength = readFile.tell()
                # Skip program name & protection value for now
                readFile.seek(0, 0)
                readFile.readline()
                readFile.readline()
                readFile.readline()
                # Write the opening code
                writeFile.write("**TI83F*\x1a\x0a\x00")
                # Read program meat
                lineNum = 4 # line numbers started from 1, and there were 3 lines beforehand.
                while readFile.tell() <= fileLength: # Ignore the last 2 bytes (checksum)
                    readLen = 1 + fileLength - readFile.tell()
                    readLen = min([maxKeyLen, readLen])
                    current = readFile.read(readLen)
                      # Try each possible key for the next few characters
                    while (readLen > 1 and not tDict.has_key(current)):
                        readFile.seek(-1*readLen, 1)
                        readLen -= 1
                        current = readFile.read(readLen)
                    if tDict.has_key(current):
                        writeBuffer.append(tDict[current])
                        if (current == "\n") or (current == "\r\n"):
                            lineNum += 1
                            # count line numbers
                    elif current == "&":
                        # The ampersand is the escape sequence character.
                        # If we got here, then:
                        # A) Someone has used the escape sequence &#, indicating
                        #    that the next character should be translated literally
                        readFile.seek(-1, 1)
                        current = readFile.read(2)
                        if current == "&#":
                            current = readFile.read(1)
                            writeBuffer.append(current)
                        # B) This is an invalid escape sequence. Let's announce that.
                        else:
                            print "%s is an invalid escape sequence on line %s" % (current, lineNum)
                            writeBuffer.append("ERROR %s" % current)
                    else:
                        # A character is unreadable!
                        print "%s not found on line &s" % (current, lineNum)
                        writeBuffer.append("ERROR %s" % current)
                programMeat="".join(writeBuffer)
                # Comment Code
                readFile.seek(0, 0)
                readFile.readline()
                readFile.readline()
                writeFile.write(readFile.readline().replace("\n", "").replace("\r", "").ljust(42)[:42])
                # After the comment comes the length of program + 19 in two bytes.
                # Note that this would crash if the program were longer than
                # 65536 characters. However, that's more than twice the TI84+ SILVER's
                # memory. Should the limit be exceeded, we've got MUCH BIGGER problems.
                writeFile.write(twoByte(len(programMeat) + 19))
                # Two more unknown characters
                writeFile.write("\x0d\x00")
                # Another length for... some... reason...
                writeFile.write(twoByte(len(programMeat) + 2))
                # Now the protection code
                # Protected means it can't be edited once on the calculator
                readFile.seek(0, 0)
                readFile.readline()
                writeFile.write(readFile.readline().replace("\n", "").replace("\r", "")=="protected\n" and "\x06" or "\x05")
                # Now the name
                readFile.seek(0, 0)
                writeFile.write(readFile.readline().replace("\n", "").replace("\r", "").ljust(8)[:8])
                # Two nulls
                writeFile.write("\x00\x00")
                # The length again... same as a few bytes before
                writeFile.write(twoByte(len(programMeat) + 2))
                # And... a different way to write the length of the program.
                writeFile.write(twoByte(len(programMeat)))
                # Now the program
                writeFile.write(programMeat)
                # Checksum - sum of all characters in program
                writeFile.write(twoByte(sum([ord(c) for c in programMeat])))
                print "%s successfully compiled as %s" % (source, destination8xp)
            except IOError:
                print "A file error occurred during translation"
            finally:
                writeFile.close()
        except IOError:
            print "Error creating %s!" % destination
        finally:
            readFile.close()
    except IOError:
        print "Error loading %s!" % source8xp

^^ That'll translate the code. I've created a short guide for syntax in order to use the escape sequences:

Spoiler:
The escape character is the ampersand. (&) To actually use an ampersand, escape it with &&. The sequence &# means that the next character will be literally copied over. It's essentially an error message given on a decompile that ensures the same code will come up after recompile. &null means nothing. This is translated by the compiler as an empty string. However, its use is to break up a command if the compiler gets confused. sin(x) will become the 3 tokens sin(, x, and ). sin&null(x) will become s, i, n, (, x, ). For help on commands, (I'm working on something better) use the command "print loadDict('help')['COMMAND_NAME_HERE']". Note that commands are case and punctuation sensitive. sin( is a command, while sin is not. neither is Sin(, SIN(, or sin().


Have fun with it.
Shameless Website Promotion: Gamma Energy
My new esoteric programming language: GLOBOL
An experiment to mess with Google Search results: HARDCORE PORNOGRAPHY HARDCORE PORNOGRAPHY
User avatar
darkspork
 
Posts: 532
Joined: Tue Sep 23, 2008 12:43 am UTC
Location: Land of Trains and Suburbs


Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests