TI-84 Plus Silver Edition EmulatorInteractive ManualGuidebook PDFOpen the calculator + guided tutorials ▶

Interactive Manual › Chapter 16

Chapter 16: Programming

Write, edit, run and manage TI-BASIC programs: the program editor, the PRGM CTL control instructions (If, For(, While, Goto, Menu(…), the PRGM I/O input and output instructions, subroutines, and what the emulator does with assembly and link-port instructions.

Getting Started: Volume of a Cylinderp. 275

A program is a list of commands that the calculator carries out one after another, exactly as if you had typed them on the home screen. In this first example you will write a program that asks for the radius R and height H of a cylinder and then shows its volume, π×R²×H.

Tutorial

Write and run the CYLINDER program

You will create a program called CYLINDER with three command lines, leave the editor, and run it with a radius of 1.5 and a height of 3.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Open the PRGM menu and move right twice to the NEW tab.
    PRGM▶︎▶︎
  2. Choose 1:Create New. The Name= prompt appears with alpha-lock already on, so the keys you press now type letters.
    ENTER
  3. Type the name CYLINDER. The 2nd + ALPHA at the start (A-LOCK) is only there so that the key caps show letters: alpha-lock is already on, and pressing it again changes nothing. The keys are [C] [Y] [L] [I] [N] [D] [E] [R].
    2ndA-LOCKCYLINDER
  4. Press ENTER to accept the name. You are now in the program editor. Every command line starts with a colon.
    ENTER
  5. Paste Prompt from the PRGM I/O menu (PRGM then ▶︎ to reach I/O, then item 2), then type the variable names R and H separated by a comma. Press ENTER to start the next line.
    PRGM▶︎2ALPHAR,ALPHAHENTER
  6. Type the formula π×R²×H and store it in V: 2ndπ is π, then R, x², H, STO► and V.
    2ndπALPHARx²ALPHAHSTO►ALPHAVENTER
  7. Paste Disp (PRGM I/O item 3). Turn on alpha-lock with 2ndA-LOCK and type the quoted text "VOLUME IS". The opening quote is ALPHA", and the space between the words is ALPHA␣. Inside alpha-lock the keys are the quote, V O L U M E, the space, I S, and the closing quote. Press ALPHA to turn alpha-lock off, then type a comma and the variable V.
    PRGM▶︎32ndA-LOCK"VOLUME␣IS"ALPHA,ALPHAV
  8. Leave the editor with 2ndQUIT (QUIT). The program is saved automatically.
    2ndQUIT
  9. Press PRGM to see the PRGM EXEC menu. Its items are the names of your programs.
    PRGM
  10. Press ENTER to paste prgmCYLINDER on the home screen.
    ENTER
  11. Press ENTER again to run it. The program asks for the radius.
    ENTER
  12. Enter 1.5 for the radius.
    1.5ENTER
  13. Enter 3 for the height. The program prints VOLUME IS, the value of V on the next line, and then Done.
    3ENTER
  14. To try other values, repeat the last three steps (paste the program name, run it, answer the prompts). On the real calculator and here, 2ndENTRY (ENTRY) recalls prgmCYLINDER so you do not have to paste it again.

Creating and Deleting Programsp. 276

This section explains what a program is, how to create one, and how to free memory by deleting or archiving programs.

What Is a Program?p. 276

A program is a set of one or more command lines. Each line holds one or more instructions. When you run a program, the calculator performs every instruction in the order you entered them. How many programs you can keep, and how long they can be, is limited only by free memory.

Things to know about programs on OS 2.55MP:

  • Programs written on OS 2.43 or earlier should still run, but may behave differently on OS 2.53MP and later. Test old programs before relying on them.
  • Programs can run in either Classic or MathPrint mode.
  • The shortcut menus (FRAC, FUNC, MTRX, YVAR) are available anywhere the MATH menu can be reached.
  • MathPrint templates (stacked fractions, n/d, etc.) cannot be used in programs. All input and output in a program uses the one-line Classic format.
  • Fractions can be used in programs, but test the program to be sure you get the results you expect.
  • Spacing on the display can differ a little between Classic and MathPrint. If you prefer the Classic spacing, switch to Classic with a mode command inside the program (for example the Classic instruction, which you can paste from the CATALOG).
  • Stat Wizards give syntax help only for the functions in the DISTR DISTR menu and for seq( in LIST OPS. Use the Catalog Help application for syntax help on everything else.
Note This emulator shows the Classic display only, so all the programs in this chapter produce Classic-format output.

Creating a New Programp. 277

To create a program:

  1. Press PRGM and move to the NEW tab with ▶︎ ▶︎.
  2. Press ENTER to select 1:Create New. The Name= prompt appears and alpha-lock is on.
  3. Press a letter from A to Z, or θ, for the first character.
  4. Type zero to seven more letters, numbers or θ to finish the name.
  5. Press ENTER. The program editor opens.
  6. Type the program commands.
  7. Press 2ndQUIT (QUIT) to leave the editor and return to the home screen.
Note A program name is one to eight characters long. The first character must be a letter A–Z or θ. The second to eighth can be letters, digits or θ. To type a digit inside the name, first press ALPHA to turn alpha-lock off.
Tutorial

Create a one-line program called HELLO

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Open the PRGM menu and go to the NEW tab.
    PRGM▶︎▶︎
  2. Select 1:Create New.
    ENTER
  3. Type the name HELLO. (Alpha-lock is already on; the A-LOCK key is included only so the keys are shown as letters.)
    2ndA-LOCKHELLO
  4. Press ENTER to open the editor.
    ENTER
  5. Paste Disp from PRGM I/O, then type the quoted text "HELLO WORLD" in alpha-lock and press ALPHA to turn alpha-lock off again.
    PRGM▶︎32ndA-LOCK"HELLO␣WORLD"ALPHA
  6. Press 2ndQUIT to quit the editor and return to the home screen.
    2ndQUIT
  7. Press PRGM. HELLO now appears on the EXEC menu.
    PRGM
  8. Press CLEAR to close the menu without choosing anything.
    CLEAR

Managing Memory and Deleting a Programp. 277

The calculator measures memory in bytes. To see whether there is enough room for a new program, press 2ndMEM (MEM) and choose 2:Mem Mgmt/Del. Then choose 7:Prgm to list your programs and their sizes. (Chapter 18 describes the memory screens in full.)

You can make more room by deleting programs you no longer need, or by archiving them.

Tutorial

Delete a program

A program called HELLO has already been created for you.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Press 2ndMEM to open the MEMORY menu.
    2ndMEM
  2. Choose 2:Mem Mgmt/Del.
    2
  3. Choose 7:Prgm. The list of programs appears with the selection cursor on the first one.
    7
  4. Move the cursor to the program you want to remove with ▲︎ and ▼︎ (it is already on HELLO), then press DEL. The calculator asks you to confirm.
    DEL
  5. Choose 2:Yes to delete. The program disappears from the list.
    2
  6. Press 2ndQUIT to return to the home screen without changing anything else.
    2ndQUIT

To leave the PRGM list without deleting anything, press 2ndQUIT, which returns to the home screen.

Archiving keeps a program but moves it out of RAM. In the same Mem Mgmt/Del 7:Prgm list, put the cursor on a program and press ENTER. An asterisk appears beside archived programs. Press ENTER on it again to unarchive it.

Note An archived program cannot be edited or run. Unarchive it first.
Tutorial

Archive and unarchive a program

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Open the MEMORY menu, then 2:Mem Mgmt/Del, then 7:Prgm.
    2ndMEM27
  2. With the cursor on HELLO, press ENTER to archive it. An asterisk marks it.
    ENTER
  3. Press ENTER again to unarchive it. The asterisk goes away.
    ENTER
  4. Return to the home screen.
    2ndQUIT

Entering Command Lines and Executing Programsp. 278

Entering a Program Command Linep. 278

You can put on a command line any instruction or expression that you could execute from the home screen. In the program editor every new command line begins with a colon. To put more than one instruction on a single line, separate them with a colon (ALPHA:).

Note A command line may be longer than the screen is wide. It simply wraps to the next row.

You can open menus while you are in the editor. To come back to the editor, either choose an item, which pastes it onto the current command line, or press CLEAR to leave the menu without choosing.

When you finish a line, press ENTER. The cursor moves to the start of the next command line.

Programs can read and change variables, lists, matrices and strings stored in memory. If a program stores a new value, that change stays in memory after the program ends. A program can also call another program as a subroutine (see Calling Other Programs as Subroutines).

Executing a Programp. 279

To run a program, start on a blank line of the home screen:

  1. Press PRGM to show the EXEC menu.
  2. Choose a program name. prgmNAME is pasted on the home screen, for example prgmCYLINDER.
  3. Press ENTER. The busy indicator in the top right shows while the program runs.
Note Ans is updated while a program runs, but the Last Entry (ENTRY) is not updated by each command in the program. The calculator checks for errors while the program runs, not while you type it.
Tutorial

Run a stored program

A program called HELLO that displays a greeting has been created for you.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Press PRGM to show the EXEC menu.
    PRGM
  2. Press ENTER to paste the name of the highlighted program.
    ENTER
  3. Press ENTER to run it. The greeting is shown, followed by Done.
    ENTER

Breaking a Programp. 279

To stop a program while it runs, press ON. The ERR:BREAK menu appears:

  • 1:Quit returns to the home screen.
  • 2:Goto opens the program editor at the place where the program was interrupted.
Tutorial

Break a running program

A program called WAITER prints a message and then pauses, over and over. Real loops that run for a long time are interrupted the same way.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Start the program from the EXEC menu.
    PRGMENTERENTER
  2. The program is waiting at a Pause. Press ON to break it. The ERR:BREAK menu appears.
    ON
  3. Choose 2:Goto to open the program at the line that was running.
    2
  4. Press 2ndQUIT to return to the home screen.
    2ndQUIT

Editing Programsp. 279

Editing a Programp. 279

To edit a stored program:

  1. Press PRGM then ▶︎ to open the EDIT tab.
  2. Choose a program name. Up to the first seven lines of the program appear.
  3. Edit the lines: move the cursor and delete, overwrite or insert. Press CLEAR to wipe everything on the command line (the leading colon stays) and then type a new command.
Note The program editor does not show a marker to say that the program continues below the bottom of the screen.
To do thisPress
Move to the start of the command line2nd◀︎
Move to the end of the command line2nd▶︎
Scroll down seven command linesALPHA▼︎
Scroll up seven command linesALPHA▲︎
Delete the character under the cursorDEL
Switch between overwrite and insert2ndINS (INS)
Clear the whole command lineCLEAR
Tutorial

Overwrite, insert, delete and clear in a program

The program EDITME has three lines, Disp 1+1, Disp 2+2 and Disp 3+3. You will change the middle one.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Press PRGM, move to the EDIT tab and choose EDITME.
    PRGM▶︎ENTER
  2. Move down to line 2 and jump to the end of the line.
    ▼︎2nd▶︎
  3. Overwrite: press ◀︎ to put the cursor on the last 2, then type 5. The new character replaces the old one.
    ◀︎5
  4. Insert: press ◀︎ to move back onto the 5, press 2ndINS (INS) to switch to insert mode, then type 1. The 1 goes in front of the 5.
    ◀︎2ndINS1
  5. Delete: press DEL to delete the character under the cursor (the 5).
    DEL
  6. Clear: press CLEAR to remove everything on this command line, then paste Disp and type 9.
    CLEARPRGM▶︎39
  7. Quit the editor.
    2ndQUIT
  8. Run the program to see the result.
    PRGMENTERENTER

Inserting and Deleting Command Linesp. 280

To insert a new command line, put the cursor where you want the new line, press 2ndINS (INS) and then ENTER. A colon marks the new line. The easiest place to do this is at the end of the line above the one you want to add.

To delete a command line, put the cursor on it, press CLEAR to remove all the instructions and expressions on the line, and then press DEL to delete the line itself, colon included.

Tutorial

Insert and delete a command line

The program LINES contains Disp 1 and Disp 3. You will insert Disp 2 between them and then delete the last line.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Open LINES from the EDIT tab and jump to the end of the first line.
    PRGM▶︎ENTER2nd▶︎
  2. Press 2ndINS (INS) then ENTER. A new, empty command line (just a colon) opens below.
    2ndINSENTER
  3. Type the new command on that line.
    PRGM▶︎32
  4. Now delete the last line. Move down to it, press CLEAR to empty it, then DEL to remove the line itself.
    ▼︎CLEARDEL
  5. Quit the editor.
    2ndQUIT

Copying and Renaming Programsp. 280

To copy every command line of one program into a new program, create the new program as described in Creating a New Program (steps 1 to 5), and then:

  1. Press 2ndRCL (RCL). Rcl appears on the bottom line of the editor.
  2. Press PRGM and move to the EXEC menu.
  3. Choose the name of the program to copy. prgmNAME is pasted on the bottom line.
  4. Press ENTER. All the command lines of that program are copied into the new one.

Copying is handy in two ways:

  • to make a template out of a group of instructions you use often;
  • to rename a program: copy its contents into a program with the new name, then delete the old one.
Note You can also copy the command lines of one program into another program that already exists, using RCL in the same way.
Tutorial

Copy HELLO into a new program

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a new program: PRGM, NEW tab, Create New.
    PRGM▶︎▶︎ENTER
  2. Name it COPYONE.
    2ndA-LOCKCOPYONEENTER
  3. Press 2ndRCL (RCL). Rcl is shown at the bottom of the screen.
    2ndRCL
  4. Open the PRGM menu and go to the EXEC tab (press ◀︎ from the first tab), then choose HELLO. Its name is pasted after Rcl. In this list COPYONE sorts before HELLO, so HELLO is item 2.
    PRGM◀︎2
  5. Press ENTER. The lines of HELLO are copied into COPYONE.
    ENTER
  6. Quit the editor.
    2ndQUIT

Scrolling the PRGM EXEC and PRGM EDIT Menusp. 280

The EXEC and EDIT menus sort your programs into alphanumeric order automatically. Only the first ten items are labeled, 1 to 9 and then 0.

  • To jump to the first program whose name starts with a particular letter (or θ), press that letter, for example ALPHAC for C.
  • From the top of either menu, press ▲︎ to jump to the bottom. From the bottom, press ▼︎ to jump to the top.
  • To move down seven items press ALPHA▼︎; to move up seven press ALPHA▲︎.
Tutorial

Jump around a long program list

Four programs exist: APPLE, BANANA, CHERRY and DATE.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Open the EXEC menu and press the letter C. The cursor jumps to the first program starting with C. Press ENTER to paste its name.
    PRGMALPHACENTER
  2. Clear the line.
    CLEAR
  3. Open the menu again and press ▲︎. From the top of the list this jumps to the very last program. Press ENTER to paste it.
    PRGM▲︎ENTER

PRGM CTL (Control) Instructionsp. 281

The control instructions decide which command runs next. They make it easy to repeat a group of commands or skip over one. To open the PRGM CTL menu, press PRGM while you are in the program editor; it is not available from the home screen. Choosing an item pastes its name at the cursor. Press CLEAR to go back to the editor without choosing.

If, While and Repeat each test a condition. Conditions are usually relational or Boolean tests (see Chapter 2), such as A<7 or N=1 and M=1. A condition is true when its value is non-zero and false when it is zero.

Tip In the tutorials below, the relation symbols come from the TEST menu (2ndTEST): = is item 1, > is 3, ≥ is 4 and < is 5.

Ifp. 282

If
:If condition:command (if true):command

Tests condition. If it is true (non-zero) the next command runs. If it is false (zero) the next command is skipped. If instructions can be nested.

Where: PRGM CTL 1 (in the program editor)
  • If A<7:A+1→A
  • If N=1 and M=1:Goto Z
Tutorial

Use If to skip a command

The program IFDEMO asks for A and displays BIG only when A is greater than 10.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called IFDEMO.
    PRGM▶︎▶︎ENTER2ndA-LOCKIFDEMOENTER
  2. Line 1: ask for A.
    PRGM▶︎2ALPHAAENTER
  3. Line 2: paste If (PRGM item 1), type A, pick > from the TEST menu, and type 10.
    PRGM1ALPHAA2ndTEST310ENTER
  4. Line 3 is the command that runs only if the test is true.
    PRGM▶︎32ndA-LOCK"BIG"ALPHAENTER
  5. Line 4 always runs, because it comes after the one command that If controls.
    PRGM▶︎32ndA-LOCK"DONE"ALPHA
  6. Quit and run the program.
    2ndQUITPRGMENTERENTER
  7. Enter 20. The test is true, so BIG is displayed.
    20ENTER
  8. Clear the screen and recall the program with 2ndENTRY (ENTRY), run it again and enter 5. This time only DONE is shown.
    CLEAR2ndENTRYENTER5ENTER

If-Then and If-Then-Elsep. 282

Then after an If runs a whole group of commands when the condition is true, and End marks the end of the group. Add Else to run a different group when the condition is false.

Then
:If condition:Then:command (if true):command (if true):End:command

Following an If, runs the group of commands up to End when the condition is true (non-zero). If the condition is false, the group is skipped and the program continues after End.

Where: PRGM CTL 2 (in the program editor)
Else
:If condition:Then:command (if true):Else:command (if false):command (if false):End:command

Following If-Then, runs the group of commands between Else and End when the condition is false (zero). Only one of the two groups runs.

Where: PRGM CTL 3 (in the program editor)
Note In OS 2.53MP and higher, the program name is shown again on the home screen when you press ENTER to repeat the program.
Tutorial

Choose between two groups of commands

The program SIGN asks for N and tells you whether it is negative.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called SIGN.
    PRGM▶︎▶︎ENTER2ndA-LOCKSIGNENTER
  2. Line 1: ask for N.
    PRGM▶︎2ALPHANENTER
  3. Line 2: if N is greater than or equal to 0 (TEST item 4).
    PRGM1ALPHAN2ndTEST40ENTER
  4. Line 3: Then starts the group that runs when the test is true.
    PRGM2ENTER
  5. Line 4: the command for the true case.
    PRGM▶︎32ndA-LOCK"ZERO␣OR␣MORE"ALPHAENTER
  6. Line 5: Else starts the group for the false case.
    PRGM3ENTER
  7. Line 6: the command for the false case.
    PRGM▶︎32ndA-LOCK"NEGATIVE"ALPHAENTER
  8. Line 7: End closes the If-Then-Else group. Every If-Then needs its own End.
    PRGM7
  9. Quit and run the program.
    2ndQUITPRGMENTERENTER
  10. Enter 3.
    3ENTER
  11. Clear the screen, run it again and enter −2 (use the (−) key for the minus sign).
    CLEAR2ndENTRYENTER(−)2ENTER

For(p. 283

For(
:For(variable,begin,end[,increment]):command:command:End:command

Loops while counting. variable starts at begin and goes up by increment each time through the loop. increment is optional and defaults to 1; it may be negative (then end must be less than begin). end is a limit that is not to be exceeded. End marks the end of the loop. For( loops can be nested.

Where: PRGM CTL 4 (in the program editor)
  • For(I,1,5) runs five times with I = 1, 2, 3, 4, 5
  • For(K,10,0,⁻2) counts down 10, 8, 6, 4, 2, 0
Tutorial

Count with a For( loop

The program SQUARES shows the squares of 1 to 4.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called SQUARES.
    PRGM▶︎▶︎ENTER2ndA-LOCKSQUARESENTER
  2. Line 1: paste For( and give the loop variable I, the first value 1 and the last value 4.
    PRGM4ALPHAI,1,4)ENTER
  3. Line 2: the command to repeat. Show I².
    PRGM▶︎3ALPHAIx²ENTER
  4. Line 3: End closes the loop.
    PRGM7
  5. Quit and run the program.
    2ndQUITPRGMENTERENTER
  6. After the loop ends the variable holds the first value that went past the limit, so I is now 5.

Whilep. 283

While
:While condition:command:command:End:command

Repeats a group of commands as long as condition is true (non-zero). The condition is tested when While is reached, before the group runs, so the group may not run at all. When the condition becomes false (zero) the program continues after End. While instructions can be nested.

Where: PRGM CTL 5 (in the program editor)
Tutorial

Repeat while a condition is true

The program DOUBLE keeps doubling N from 1 until it reaches 50 or more.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called DOUBLE.
    PRGM▶︎▶︎ENTER2ndA-LOCKDOUBLEENTER
  2. Line 1: start N at 1.
    1STO►ALPHANENTER
  3. Line 2: While N is less than 50.
    PRGM5ALPHAN2ndTEST550ENTER
  4. Line 3: double N.
    ALPHAN×2STO►ALPHANENTER
  5. Line 4: End closes the loop.
    PRGM7ENTER
  6. Line 5: show the result.
    PRGM▶︎3ALPHAN
  7. Quit and run. N goes 1, 2, 4, 8, 16, 32, 64 and then the test fails.
    2ndQUITPRGMENTERENTER

Repeatp. 284

Repeat
:Repeat condition:command:command:End:command

Repeats a group of commands until condition is true (non-zero). It is like While, but the condition is tested when End is reached, so the group always runs at least once. Repeat instructions can be nested.

Where: PRGM CTL 6 (in the program editor)
Tutorial

Repeat until a condition is true

The program COUNT displays 1, 2, 3 and stops when N equals 3.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called COUNT.
    PRGM▶︎▶︎ENTER2ndA-LOCKCOUNTENTER
  2. Line 1: start N at 0.
    0STO►ALPHANENTER
  3. Line 2: Repeat N equals 3 (TEST item 1).
    PRGM6ALPHAN2ndTEST13ENTER
  4. Line 3: add 1 to N.
    ALPHAN+1STO►ALPHANENTER
  5. Line 4: show N.
    PRGM▶︎3ALPHANENTER
  6. Line 5: End. The test happens here.
    PRGM7
  7. Quit and run.
    2ndQUITPRGMENTERENTER

Endp. 284

End
:End

Marks the end of a group of commands. Every For(, While and Repeat loop needs an End, and so does every If-Then and If-Then-Else group. Paste End yourself: the calculator does not add it for you.

Where: PRGM CTL 7 (in the program editor)

Pausep. 284

Pause
PausePause value

Suspends the program so you can read answers or look at a graph. While it waits, the pause indicator shows in the top right corner. Press ENTER to continue. Plain Pause just waits, and shows the screen that Disp or DispGraph last put up. Pause value shows value on the current home screen, and you can scroll long values with the arrow keys.

Where: PRGM CTL 8 (in the program editor)
Tutorial

Wait for ENTER with Pause

The program PAUSER stops twice, once with a plain Pause and once with a value.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called PAUSER.
    PRGM▶︎▶︎ENTER2ndA-LOCKPAUSERENTER
  2. Line 1: display a message.
    PRGM▶︎32ndA-LOCK"READY"ALPHAENTER
  3. Line 2: a plain Pause.
    PRGM8ENTER
  4. Line 3: Pause with a value shows the value while it waits.
    PRGM82+3ENTER
  5. Line 4: runs after the second pause.
    PRGM▶︎32ndA-LOCK"GO"ALPHA
  6. Quit and run. The program stops after READY.
    2ndQUITPRGMENTERENTER
  7. Press ENTER to continue. The second Pause shows 5 and waits again.
    ENTER
  8. Press ENTER once more. The last line runs and the program ends.
    ENTER

Lbl, Gotop. 285

Lbl and Goto work as a pair. Lbl gives a spot in the program a name, and Goto jumps to that spot. A label is one or two characters: A–Z, 0–99 or θ. Labels belong to the program they are in; you cannot Goto a label in another program.

Lbl
Lbl label

Defines a label (one or two characters: A–Z, 0–99 or θ) that Goto can jump to.

Where: PRGM CTL 9 (in the program editor)
Goto
Goto label

Continues the program at the Lbl with the same label. If no such label exists in the program, the error ERR:LABEL results.

Where: PRGM CTL 0 (in the program editor)
Tutorial

Loop with Lbl and Goto

The program LOOPER counts to 3 by jumping back to a label.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called LOOPER.
    PRGM▶︎▶︎ENTER2ndA-LOCKLOOPERENTER
  2. Line 1: N starts at 0.
    0STO►ALPHANENTER
  3. Line 2: Lbl A marks the place to come back to.
    PRGM9ALPHAAENTER
  4. Line 3: add 1 to N.
    ALPHAN+1STO►ALPHANENTER
  5. Line 4: show N.
    PRGM▶︎3ALPHANENTER
  6. Line 5: if N is less than 3 ...
    PRGM1ALPHAN2ndTEST53ENTER
  7. Line 6: ... Goto A jumps back (only when the If is true).
    PRGM0ALPHAAENTER
  8. Line 7: runs once the loop is finished.
    PRGM▶︎32ndA-LOCK"DONE"ALPHA
  9. Quit and run.
    2ndQUITPRGMENTERENTER

IS>( and DS<(p. 286

IS>(
IS>(variable,value):command (if answer ≤ value):command (if answer > value)

Increment and skip. Adds 1 to variable. If the new value is greater than value (which may be an expression) the next command is skipped; if it is less than or equal, the next command runs. variable cannot be a system variable. IS>( is not a looping instruction.

Where: PRGM CTL A (in the program editor)
DS<(
DS<(variable,value):command (if answer ≥ value):command (if answer < value)

Decrement and skip. Subtracts 1 from variable. If the new value is less than value (which may be an expression) the next command is skipped; if it is greater than or equal, the next command runs. variable cannot be a system variable. DS<( is not a looping instruction.

Where: PRGM CTL B (in the program editor)
Tutorial

Skip a command with IS>( and DS<(

The program SKIPPER sets A to 3, then uses each instruction once. Only two of the Disp commands end up running.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called SKIPPER.
    PRGM▶︎▶︎ENTER2ndA-LOCKSKIPPERENTER
  2. Line 1: A starts at 3.
    3STO►ALPHAAENTER
  3. Line 2: IS>(A,3) makes A equal 4. 4 is greater than 3, so line 3 is skipped.
    PRGMALPHAAALPHAA,3)ENTER
  4. Line 3: this is skipped.
    PRGM▶︎32ndA-LOCK"ONE"ALPHAENTER
  5. Line 4: DS<(A,2) makes A equal 3. 3 is not less than 2, so line 5 runs.
    PRGMALPHABALPHAA,2)ENTER
  6. Line 5: this runs.
    PRGM▶︎32ndA-LOCK"TWO"ALPHAENTER
  7. Line 6: show A.
    PRGM▶︎3ALPHAA
  8. Quit and run. You see TWO and 3, but never ONE.
    2ndQUITPRGMENTERENTER

Menu(p. 286

Menu(
Menu("title","text1",label1,"text2",label2,…)

Sets up branching. When the program reaches Menu( it shows a menu screen with the title and the items you gave, turns on the pause indicator and waits until you choose an item. You then go to the label that belongs to that item. The title and each text are in quotation marks. Up to seven pairs of text,label may follow the title.

Where: PRGM CTL C (in the program editor)
Tutorial

Build a two-item menu

The program PICKER shows a menu and then says which item you chose.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called PICKER.
    PRGM▶︎▶︎ENTER2ndA-LOCKPICKERENTER
  2. Line 1: paste Menu(, then the title "PICK", and two pairs of item text and label: "ONE" goes to label A, "TWO" goes to label B.
    PRGMALPHAC2ndA-LOCK"PICK"ALPHA,2ndA-LOCK"ONE"ALPHA,ALPHAA,2ndA-LOCK"TWO"ALPHA,ALPHAB)ENTER
  3. Line 2: the label for the first choice.
    PRGM9ALPHAAENTER
  4. Line 3: the action for the first choice.
    PRGM▶︎32ndA-LOCK"ONE␣CHOSEN"ALPHAENTER
  5. Line 4: Stop ends the program so it does not run on into the second choice.
    PRGMALPHAFENTER
  6. Line 5: the label for the second choice.
    PRGM9ALPHABENTER
  7. Line 6: the action for the second choice.
    PRGM▶︎32ndA-LOCK"TWO␣CHOSEN"ALPHA
  8. Quit and run. The program pauses on the menu.
    2ndQUITPRGMENTERENTER
  9. Press 2 (or move to item 2 and press ENTER). The program continues at Lbl B.
    2

prgmp. 287

prgm
prgmname

Runs another program as a subroutine. Choosing prgm pastes it at the cursor and you then spell out the program name. This is the same as picking the program from the PRGM EXEC menu, except you can type the name of a program that does not exist yet. See Calling Other Programs as Subroutines.

Where: PRGM CTL D (in the program editor)
Note You cannot type the name of a subroutine directly when you use RCL to copy a program. Paste the name from the PRGM EXEC menu instead.

Return and Stopp. 287

Return
Return

Quits the subroutine and goes back to the program that called it, even from inside nested loops (the loops are ended). Every subroutine has an implied Return at its end. In a main program, Return stops execution and returns to the home screen.

Where: PRGM CTL E (in the program editor)
Stop
Stop

Stops the program and returns to the home screen. Stop at the very end of a program is optional.

Where: PRGM CTL F (in the program editor)

DelVarp. 287

DelVar
DelVar variable

Deletes the contents of variable from memory. A real-number variable goes back to 0.

Where: PRGM CTL G (in the program editor)
Tutorial

Delete a variable from a program

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called CLEANUP.
    PRGM▶︎▶︎ENTER2ndA-LOCKCLEANUPENTER
  2. Line 1: store 5 in A.
    5STO►ALPHAAENTER
  3. Line 2: DelVar A deletes it.
    PRGMALPHAGALPHAAENTER
  4. Line 3: show A.
    PRGM▶︎3ALPHAA
  5. Quit and run. A is back to 0.
    2ndQUITPRGMENTERENTER

GraphStyle(p. 288

GraphStyle(
GraphStyle(function#,graphstyle)

Sets the style that a graph function is drawn in. function# is the number of the Y= function name in the current graphing mode, and graphstyle is a number from 1 to 7. Not every style is available in every graphing mode; see the Graph Styles table in Chapter 3.

Where: PRGM CTL H (in the program editor)
  • GraphStyle(1,5) in Func mode sets the style of Y₁ to path (5).
graphstyleStyle
1Line
2Thick
3Shade above
4Shade below
5Path
6Animate
7Dot
Tutorial

Set a graph style from a program

Y₁ is already set to X². The program STYLER draws it in the path style.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called STYLER.
    PRGM▶︎▶︎ENTER2ndA-LOCKSTYLERENTER
  2. Line 1: GraphStyle( for function 1, style 5 (path).
    PRGMALPHAH1,5)ENTER
  3. Line 2: DispGraph (PRGM I/O item 4) draws the graph.
    PRGM▶︎4ENTER
  4. Line 3: Pause keeps the graph on the screen until you press ENTER.
    PRGM8
  5. Quit and run. The graph appears and the program waits.
    2ndQUITPRGMENTERENTER
  6. Press ENTER to finish. The program ends with the graph still on screen; press CLEAR to return to the home screen.
    ENTERCLEAR

OpenLib( and ExecLib(p. 281

OpenLib(
OpenLib(libname)

No longer used. The item remains on the PRGM CTL menu for old programs, but it has no effect on a TI-84 Plus Silver Edition running OS 2.55MP. In this emulator it gives ERR:INVALID.

Where: PRGM CTL I (in the program editor)
ExecLib(
ExecLib libname

No longer used. See OpenLib(. In this emulator it gives ERR:INVALID.

Where: PRGM CTL J (in the program editor)

PRGM I/O (Input/Output) Instructionsp. 288

The I/O instructions control what goes into a program while it runs (values the user types, key presses) and what comes out (text, numbers, graphs, tables). Open the PRGM I/O menu with PRGM ▶︎ from within the program editor; it is not available from the home screen. Press CLEAR to go back to the editor without choosing an item.

Displaying a Graph with Inputp. 289

Input
InputInput [variable]Input ["text",variable]Input [Strn,variable]

With no variable, Input shows the current graph. You can move the free-moving cursor, which updates X and Y (and R and θ for PolarGC format), while the pause indicator is on. Press ENTER to continue the program. With a variable, it asks for a value (see the next sections).

Where: PRGM I/O 1 (in the program editor)
Tutorial

Pick a point on the graph

Y₁ is set to X². The program FREEPT shows the graph, lets you move the cursor, and then displays the X value where you left it.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called FREEPT.
    PRGM▶︎▶︎ENTER2ndA-LOCKFREEPTENTER
  2. Line 1: Input with nothing after it.
    PRGM▶︎1ENTER
  3. Line 2: show the X coordinate of the cursor.
    PRGM▶︎3X,T,θ,n
  4. Quit and run. The graph appears with a cursor and the program waits.
    2ndQUITPRGMENTERENTER
  5. Press ▶︎ a few times to move the cursor.
    ▶︎▶︎▶︎
  6. Press ENTER. The program resumes and shows the X value of the cursor.
    ENTER

Storing a Variable Value with Inputp. 289

With a variable, Input shows a ? prompt while the program runs. The variable can be a real or complex number, a list, a matrix, a string or a Y= function. Type a value (it can be an expression) and press ENTER. The value is evaluated, stored in the variable, and the program carries on.

You can show your own prompt text (or the contents of a string variable Strn) of up to 16 characters instead of the ?: Input "text",variable or Input Strn,variable.

Note When a program asks for a list or a Y= function, you must type the braces { } around the list elements and the quotation marks around the expression.
Tutorial

Ask for a value with Input

The program TIMES asks for A with the default prompt and for B with your own prompt text, then shows A×B.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called TIMES.
    PRGM▶︎▶︎ENTER2ndA-LOCKTIMESENTER
  2. Line 1: Input A uses the plain ? prompt.
    PRGM▶︎1ALPHAAENTER
  3. Line 2: a prompt with your own text, "SECOND", stored in B.
    PRGM▶︎12ndA-LOCK"SECOND"ALPHA,ALPHABENTER
  4. Line 3: show the product.
    PRGM▶︎3ALPHAA×ALPHAB
  5. Quit and run. The program shows a ? and waits.
    2ndQUITPRGMENTERENTER
  6. Enter 6.
    6ENTER
  7. Enter 7. The product is displayed.
    7ENTER
Tutorial

Use a string variable as the prompt

The program ASKN stores a prompt in Str1 and passes it to Input, then doubles the number you enter.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called ASKN.
    PRGM▶︎▶︎ENTER2ndA-LOCKASKNENTER
  2. Line 1: store the text in Str1. Type the quoted text, press STO►, then choose Str1 from VARS → 7:String → 1:Str1.
    2ndA-LOCK"HOW␣MANY?"ALPHASTO►VARS71ENTER
  3. Line 2: Input with the string as the prompt, storing the answer in N.
    PRGM▶︎1VARS71,ALPHANENTER
  4. Line 3: show double the answer.
    PRGM▶︎3ALPHAN×2
  5. Quit and run. Your text is the prompt.
    2ndQUITPRGMENTERENTER
  6. Enter 21.
    21ENTER
Tutorial

Ask for a list with Input

The program LISTIN reads a list into L₁. The braces are part of what you type.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called LISTIN.
    PRGM▶︎▶︎ENTER2ndA-LOCKLISTINENTER
  2. Line 1: Input L₁ (2ndL1 is L₁).
    PRGM▶︎12ndL1ENTER
  3. Line 2: show the list.
    PRGM▶︎32ndL1
  4. Quit and run.
    2ndQUITPRGMENTERENTER
  5. Type the list including its braces (2nd{ and 2nd}) and press ENTER.
    2nd{1,2,32nd}ENTER

Promptp. 290

Prompt
Prompt variableA[,variableB,…,variable n]

While the program runs, Prompt shows each variable in turn followed by =?. At each prompt, type a value or expression and press ENTER. The values are stored and the program resumes. Y= functions are not valid with Prompt.

Where: PRGM I/O 2 (in the program editor)
Tutorial

Prompt for two variables

The program ADDER asks for A and B and prints their sum.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called ADDER.
    PRGM▶︎▶︎ENTER2ndA-LOCKADDERENTER
  2. Line 1: Prompt A,B.
    PRGM▶︎2ALPHAA,ALPHABENTER
  3. Line 2: show the sum.
    PRGM▶︎3ALPHAA+ALPHAB
  4. Quit and run. The first prompt is A=?.
    2ndQUITPRGMENTERENTER
  5. Type 4 and press ENTER. Now it asks for B.
    4ENTER
  6. Type 2+3, an expression. It is evaluated before it is stored.
    2+3ENTER

Displaying the Home Screen and Values (Disp)p. 290

Disp
DispDisp [valueA,valueB,valueC,…,value n]

With nothing after it, Disp shows the home screen. Follow it with Pause if you want to look at the home screen during a program. With values, it displays each one. A variable shows its current value; an expression is evaluated and the result is shown on the right side of the next line; text inside quotation marks is shown on the left side of the current line. The store arrow → cannot be used in the text. If Pause comes after Disp, the program waits so you can read the screen, and ENTER resumes it.

Where: PRGM I/O 3 (in the program editor)
  • Disp "A IS",A,A²+1
Note If a list or matrix is too wide to display, ellipses (...) appear in the last column and you cannot scroll it. Use Pause value to scroll through it instead.
Tutorial

Display text, variables and expressions

The program SHOWME stores 5 in A and displays a message, A, and the expression A²+1.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called SHOWME.
    PRGM▶︎▶︎ENTER2ndA-LOCKSHOWMEENTER
  2. Line 1: store 5 in A.
    5STO►ALPHAAENTER
  3. Line 2: one Disp with three items, separated by commas.
    PRGM▶︎32ndA-LOCK"A␣IS"ALPHA,ALPHAA,ALPHAAx²+1
  4. Quit and run. The text is on the left of its line; the values are on the right of the lines below.
    2ndQUITPRGMENTERENTER

DispGraph and DispTablep. 291

DispGraph
DispGraph

Displays the current graph. If Pause comes after DispGraph, the program waits so you can look at the graph; press ENTER to resume.

Where: PRGM I/O 4 (in the program editor)
DispTable
DispTable

Displays the current table. The program waits so you can look at it; press ENTER to resume.

Where: PRGM I/O 5 (in the program editor)
Tutorial

Show the graph from a program

Y₁ is set to X². The program SHOWG draws the graph and waits.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called SHOWG.
    PRGM▶︎▶︎ENTER2ndA-LOCKSHOWGENTER
  2. Line 1: DispGraph (PRGM I/O item 4).
    PRGM▶︎4ENTER
  3. Line 2: Pause keeps the graph on the screen.
    PRGM8
  4. Quit and run. The graph is displayed and the program waits.
    2ndQUITPRGMENTERENTER
  5. Press ENTER to resume. The program ends, leaving the graph on screen; press CLEAR to go back to the home screen.
    ENTERCLEAR
Tutorial

Show the table from a program

Y₁ is set to X². The program SHOWT displays the table and then a message.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called SHOWT.
    PRGM▶︎▶︎ENTER2ndA-LOCKSHOWTENTER
  2. Line 1: DispTable (PRGM I/O item 5).
    PRGM▶︎5ENTER
  3. Line 2: runs once you resume.
    PRGM▶︎32ndA-LOCK"BACK"ALPHA
  4. Quit and run. The table is displayed and the program waits.
    2ndQUITPRGMENTERENTER
  5. Press ENTER to resume. The message is displayed.
    ENTER

Output(p. 291

Output(
Output(row,column,"text")Output(row,column,value)

Displays text or a value on the current home screen starting at row (1 to 8) and column (1 to 16), writing over whatever was there. Expressions are evaluated and shown according to the current mode settings. Matrices are shown in entry format and wrap to the next line. The store arrow → cannot be used in the text. On a Horiz split screen the largest row is 4. It is usual to put ClrHome in front of Output(.

Where: PRGM I/O 6 (in the program editor)
Tutorial

Place text and values with Output(

The program PLACER clears the screen, writes HI at row 3, column 6, and puts the value of 2+3 at row 5, column 1.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called PLACER.
    PRGM▶︎▶︎ENTER2ndA-LOCKPLACERENTER
  2. Line 1: ClrHome (PRGM I/O item 8) clears the screen.
    PRGM▶︎8ENTER
  3. Line 2: text at row 3, column 6.
    PRGM▶︎63,6,2ndA-LOCK"HI"ALPHA)ENTER
  4. Line 3: a value at row 5, column 1.
    PRGM▶︎65,1,2+3)ENTER
  5. Line 4: Pause keeps the screen up until you press ENTER.
    PRGM8
  6. Quit and run.
    2ndQUITPRGMENTERENTER
  7. Press ENTER to end the program.
    ENTER

getKeyp. 292

getKey
getKey

Returns the code of the last key pressed, or 0 if no key has been pressed. Use it inside a loop to react to keys, for example when writing a game. You can press ON at any time to break the program.

Where: PRGM I/O 7 (in the program editor)
  • getKey→K stores 105 in K if ENTER was pressed.
Key codes returned by getKey (row digit, then column digit)
RowKeys and their codes
1Y= 11, WINDOW 12, ZOOM 13, TRACE 14, GRAPH 15
22nd 21, MODE 22, DEL 23, ◀︎ 24, ▲︎ 25, ▶︎ 26
3ALPHA 31, X,T,θ,n 32, STAT 33, ▼︎ 34
4MATH 41, APPS 42, PRGM 43, VARS 44, CLEAR 45
5x⁻¹ 51, SIN 52, COS 53, TAN 54, ^ 55
6x² 61, , 62, ( 63, ) 64, ÷ 65
7LOG 71, 7 72, 8 73, 9 74, × 75
8LN 81, 4 82, 5 83, 6 84, − 85
9STO► 91, 1 92, 2 93, 3 94, + 95
100 102, . 103, (−) 104, ENTER 105
Tutorial

Read a key press with getKey

The program KEYTEST loops until you press a key, then shows its code.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called KEYTEST.
    PRGM▶︎▶︎ENTER2ndA-LOCKKEYTESTENTER
  2. Line 1: K starts at 0.
    0STO►ALPHAKENTER
  3. Line 2: Repeat K keeps looping until K is not zero.
    PRGM6ALPHAKENTER
  4. Line 3: getKey (PRGM I/O item 7) stores the key code in K.
    PRGM▶︎7STO►ALPHAKENTER
  5. Line 4: End.
    PRGM7ENTER
  6. Line 5: show the code.
    PRGM▶︎3ALPHAK
  7. Quit and run. The program now waits for a key.
    2ndQUITPRGMENTERENTER
  8. Press the 5 key. Its code is 83.
    5

ClrHome and ClrTablep. 292

ClrHome
ClrHome

Clears the home screen while the program runs.

Where: PRGM I/O 8 (in the program editor)
ClrTable
ClrTable

Clears the values in the table while the program runs (the entries of a table whose independent variable is set to Ask).

Where: PRGM I/O 9 (in the program editor)

GetCalc(p. 292

GetCalc(
GetCalc(variable[,portflag])

Gets the contents of variable from another TI-84 Plus and stores it in the same variable on the receiving calculator. The variable can be a real or complex number, list element, list name, matrix element, matrix name, string, Y= variable, graph database or picture. By default the USB port is used if a cable is connected, otherwise the I/O port. portflag 0 means use the USB port if connected, 1 means use the USB port, and 2 means use the I/O port.

Where: PRGM I/O 0 (in the program editor)
Note GetCalc( does not work between a TI-82 and a TI-83 Plus or TI-84 Plus.
Note The emulator has no link port or second calculator, so GetCalc( gives ERR:INVALID when it runs. The menu item and the syntax are still accepted in the editor.

Get( and Send(p. 293

Get(
Get(variable)

Gets data from a CBL 2 or CBR and stores it in variable on the receiving TI-84 Plus. The variable can be a real number, list element, list name, matrix element, matrix name, string, Y= variable, graph database or picture.

Where: PRGM I/O A (in the program editor)
Send(
Send(variable)

Sends the contents of variable to a CBL 2 or CBR. You cannot use it to send to another TI-84 Plus. The variable can be a real number, list element, list name, matrix element, matrix name, string, Y= variable, graph database or picture, or a list of elements.

Where: PRGM I/O B (in the program editor)
Note If you bring a program that uses Get( from a TI-82, the TI-84 Plus reads it as the Get( described here. Use GetCalc( to get data from another TI-84 Plus. You can also paste Get(, Send( and GetCalc( from the CATALOG (2ndCATALOG) to run them from the home screen.
Note The emulator has no CBL 2, CBR or link port, so Get( and Send( give ERR:INVALID when they run.

Calling Other Programs as Subroutinesp. 293

Any stored program can be called from another program as a subroutine. Put the name of the program to call on a line by itself. You can enter the name in either of two ways:

  • Press PRGM, move to the EXEC tab and choose the program. prgmNAME is pasted at the cursor.
  • Choose prgm from the PRGM CTL menu (item D) and then type the name of the program.

When the line prgmNAME is reached, the next command to run is the first command of the second program. When it reaches a Return, or runs off its end (an implied Return), execution continues with the command after the call in the first program.

Notes about calling programs:

  • Variables are global: both programs see and change the same variables.
  • Labels used with Lbl and Goto are local to the program they are in. A label in one program is not known to another, and you cannot Goto a label in a different program.
  • Return leaves the subroutine and goes back to the calling program, even when it is inside nested loops.
Tutorial

Call a subroutine and return from it

The program SUB already exists: it displays IN SUB, then does Return, then has a line that never runs. You will write MAIN, which calls it.

▶ Try this step-by-step on the online TI-84 Plus — keys light up as you go

  1. Create a program called MAIN.
    PRGM▶︎▶︎ENTER2ndA-LOCKMAINENTER
  2. Line 1: display a message.
    PRGM▶︎32ndA-LOCK"START"ALPHAENTER
  3. Line 2: call SUB. Press PRGM, go to the EXEC tab with ◀︎, and choose SUB (item 2, since MAIN sorts before it). The name is pasted as prgmSUB.
    PRGM◀︎2ENTER
  4. Line 3: display a message after the call.
    PRGM▶︎32ndA-LOCK"BACK"ALPHA
  5. Quit and run MAIN, the first program on the EXEC menu.
    2ndQUITPRGMENTERENTER
Tip The PRGM CTL entry prgm lets you type the name of a program that you have not written yet, so you can write the main program first and the subroutines afterwards.

Running an Assembly Language Programp. 294

The TI-84 Plus can run programs written in assembly language. They usually run much faster than programs written with the built-in editor and give much finer control of the calculator. When you download an assembly program, it is stored with your other programs and appears on the PRGM menus. You can send it over the link (Chapter 19) and delete it from the MEM MGMT/DEL screen (Chapter 18).

Note An assembly program has direct control of the hardware. If it has a bug, it can reset the calculator and erase all data, programs and applications in memory.
Asm(
Asm(assemblyprgmname)

Runs an assembly language program. Paste Asm( from the CATALOG (2ndCATALOG) and then add the program name, for example with prgm from the PRGM EXEC menu.

Where: CATALOG
AsmPrgm
AsmPrgm

Identifies an assembly language program. It must be the first line of the program.

Where: CATALOG
AsmComp(
AsmComp(prgmASM1,prgmASM2)

Compiles an assembly language program that is written in ASCII hex (the first program) and stores the machine-code version in a new program (the second).

Where: CATALOG
  • AsmComp(prgmASM1,prgmASM2)

To compile an assembly program that you have written:

  1. Write the program as usual (see Creating a New Program) but make AsmPrgm the first line.
  2. On the home screen press 2ndCATALOG (CATALOG) and choose AsmComp( to paste it.
  3. Press PRGM to show the EXEC menu.
  4. Choose the program to compile. It is pasted on the home screen.
  5. Press ,, then choose prgm from the CATALOG.
  6. Key in the name you want for the output program. The name must be new, not a copy of an existing program name.
  7. Press ) to finish the sequence. The arguments are in this order: AsmComp(prgmASM1,prgmASM2).
  8. Press ENTER to compile the program and create the output program.
InstructionComments
AsmComp(prgmASM1,prgmASM2)Compiles an assembly language program written in ASCII and stores the hex version
AsmPrgmIdentifies an assembly language program; must be entered as the first line of an assembly language program
Note The emulator cannot run machine code. Asm(, AsmComp( and AsmPrgm are recognised, but running them gives ERR:INVALID. Programs written in TI-BASIC work normally.