Assembly Language Programming Overview; What Are Asm Programs; Hardware Stack; Register Usage - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

6.

Assembly Language Programming Overview

This chapter covers how to use assembly language to write programs for the
TI-89 / TI-92 Plus calculator. You should already know how to write programs in
assembly language and be familiar with Motorola 68000 architecture. See the
TI Web site and the TI-89 / TI-92 Plus Guidebook.
6.1.

What are ASM Programs?

ASM programs are subroutines written in 68000 assembly language. Because
they appear as data type ASM in the VAR-LINK window, they are called ASM
programs. They can be called from TI-BASIC programs or from the Home screen
author line just like other TI-BASIC subroutines but with the advantage of speed
and direct control of calculator resources that TI-BASIC as an interpreted
language could never attain. ASM programs cannot, however, return function
values on the estack to TI-BASIC.
ASM programs are small ( 8 K for AMS 2.03 and
execute in RAM. They are easy to share with other calculators through the link
port. You should consider developing a Flash application if your assembly
language program is large. Because Flash applications are loaded into and
execute from Flash ROM, they do not take up precious RAM. Additionally, your
Flash applications enjoy a measure of copy protection that ASM programs do not
provide.
6.2.

Hardware Stack

The user hardware stack is 15.5 KB in size located from 0x0400 to 0x4BFF in
memory. The stack serves four main purposes: it holds the return address from
subroutine calls, subroutine parameters are passed on the stack, subroutine local
variables are allocated on the stack, and register contents can be temporarily
pushed onto and popped from the stack.
There is special circuitry in the calculator which detects stack overflow. An
attempt to push a value or call a subroutine when the stack pointer is below
0x0400 causes level 7 auto-vector interrupt (address at memory location
0x007C) to occur. The level 7 auto-vector handler throws a protected memory
error. See chapter 10. Error Handling to learn how to catch errors.
6.3.

Register Usage

Register A7 is the stack pointer. Do not use A7 for anything else. The stack
contains the return address to the TI-BASIC interpreter when your ASM program
is called.
TI-89 / TI-92 Plus Developer Guide
Not for Distribution
24 K for AMS 2.04) and
Beta Version January 26, 2001
25

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents