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 #70 background imageLoading...
Page #70 background image
28
Chapter 6: Assembly Language Programming Overview
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
Its C prototype is:
short mySubr(short a, short b);
The Assembly language subroutine is:
;subroutine entry
mySubr:
link a6,#-8 ; allocate 8 bytes for local
; variables
movem.l d3-d4/a2,-(sp) ; save registers
.
.
.
move.w 8(a6),d0 ; get parameter
a
from caller
move.w d0,-8(a6) ; save in local variable storage
.
.
.
;subroutine exit
move.w -2(a6),d0 ; return function result in D0
movem.l (sp)+,d3-d4/a2 ; restore registers
unlk a6 ; free stack space
rts ; return from subroutine
Here is how stack memory looks in the above example after subroutine entry.
12 bytes 8 bytes 4 bytes 4 bytes 2 bytes 2 bytes
L
20(a6)
L
8(a6) 0(a6) 4(a6) 8(a6) 10(a6)
saved D3, D4, and A2 local variables saved A6 return
address
ab
Figure 6.1: Example of ASM Stack Memory
A6
A7

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