EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Developer's Guide

Texas Instruments TI-89
1398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #71 background imageLoading...
Page #71 background image
Chapter 6: Assembly Language Programming Overview
29
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
6.6. Sample ASM Program
ASM programs do not have to be written in assembly language. Here is a sample
ASM written in C. ASM program
waitkey
accepts a keypress from the user. It
turns on the PAUSE indicator in the status line and puts the calculator in low
power mode until a key is pressed. The key code for the pressed key is stored in
a variable of the programmer’s choosing.
/* ASM program to wait for a keypress. Go into idle mode until a
key is pressed. */
#include "tiams.h"
/* Entry point must be called main */
void main(void)
{
Access_AMS_Global_Variables;
Event e;
USHORT ch;
EStackIndex varname;
varname = top_estack;
/* Argument must be string containing name of a variable */
if (ESTACK(varname) != STR_DATA_TAG)
ER_throw(ER_ARG_MUST_BE_STRING);
/* Get pointer to beginning of variable name */
varname = next_expression_index(varname-1) + 2;
/* Make sure name is legal and not reserved for something else */
if (TokenizeSymName(varname, TSF_PASS_ERRORS) == NULL)
ER_throw(ER_INDIR_STRING_NOT_VARNAME);
varname = top_estack;
/* Get a keypress */
while ((ch = EV_getc(ST_PAUSE, &e)) == 0)
;
/* Push character number onto estack */
push_ushort_to_integer(ch);
/* Pop character number into variable */
VarStore(varname, STOF_ESI, 0, top_estack);
}
To get a keypress code into, say, variable k, in your TI
-
BASIC program call
waitkey
(“k”).

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals