Texas Instruments TI89 Developer Guide - Page 67
Assembly Language Programming Overview, What are ASM Programs?, Hardware Stack, Register Usage
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 67 highlights
25 6. 6.1. 6.2. 6.3. 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. 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 ≤ 24 K for AMS 2.04) 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. 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. 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 Beta Version January 26, 2001