EasyManua.ls Logo

Texas Instruments TMS34010 User Manual

Texas Instruments TMS34010
128 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 #48 background imageLoading...
Page #48 background image
TMS34010
C
Run-Time
Environment
5.5.5
Restoration
of
the
Caller's
Environment
It
is the responsibility
of
the called
function
to
restore the environment
of
the
caller before returning. In general, this involves restoration
of
the caller's reg-
isters and
deletion
of
the local frame
(including
arguments).
The first task
is
to
restore the caller's registers. This can be done
with
an
MMFM
instruction, corresponding
to
the
MMTM
given at function entry.
Note
that
the status register need
not
be saved
or
restored.
If
local variables
were allocated, the frame pointer must also be restored and shouid
be
included
in the register list
for
the register save instructions.
There
are
two
methods for deletion
of
local variables and arguments:
Function returns value
on
stack,
or
has arguments. In the latter the old
program stack pointer
is
pushed on the stack
(below
the old value). To
restore the
caller's stack,
copy
this value from the system stack (SP)
to
the program stack pointer,
A14
(STK).
No
arguments, no return value on stack.
If
a local frame was allocated,
decrement
A14
by
the size
of
the local frame and return.
If
no frame was
allocated,
just
return.
Note
that
the
old
program stack pointer
is
not
saved for either
(1
) the case
of
values returned on the stack
or
(2)
the case
of
no arguments.
5.5.6
Return
from
Function
The last instruction executed
by
the function
is
a
RETS.
Normally, the'
in-
struction has
an
argument
of
zero,
but
if
the function had arguments
or
re-
turned a
value on the stack, the instruction
RETS
2 must be executed
to
pop
the caller's
old
program stack pointer
off
the stack,
5.6
Interrupt
Handling
Interrupts can be handled directly
with
C functions through the use
of
re-
served function names. These names
are
of
the form: .
c-
int##
where
two
pound
signs
(##)
indicate a
two-digit
interrupt number. For ex-
ample:
c-intOO
(system
reset
interrupt)
c-intOl
.,.
c-int99
By naming a
function
in this way, the user specifies
that
the function is to be
used
to
handle
an
interrupt, and the codegen generates special code
for
an
interrupt routine.
Any
register used
(with
the exception
of
SP and STK)
is
saved by the interrupt
handler,
including
AB.
In a normal
function,
A8
need
not
be saved; however,
in the case
of
an
interrupt,
A8
must
be
saved.
To return from the interrupt, use the
RETI
instruction. This restores the status
of
the interrupted function, .
5-11

Table of Contents

Other manuals for Texas Instruments TMS34010

Question and Answer IconNeed help?

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

Texas Instruments TMS34010 Specifications

General IconGeneral
ManufacturerTexas Instruments
ModelTMS34010
Data Bus Width32-bit
Operating Voltage5 V
Year Introduced1986
CategoryGraphics Processor Unit (GPU)
Clock Speed40 MHz (Maximum)
Instruction SetCustom
Graphics Capabilities2D graphics
PackagePGA
Resolution Supportup to 1024x768
Architecture32-bit RISC

Summary

TMS34010 C Compiler Package Product Overview

Applicable Documents

Lists related Texas Instruments and C programming publications.

Documentation Conventions

Explains symbols and formatting used in the guide.

TMS34010 C Compiler Package Installation

Installation for Texas Instruments and IBM PC Systems

Details installation steps for PC systems, including hardware requirements and diskette usage.

VAX/VMS Systems Installation

Covers tape mounting, VMS commands, and setup for VAX/VMS.

VAX/ULTRIX and VAX/UNIX System V Installation

Outlines tape installation and tool verification for ULTRIX and UNIX systems.

Invocation and Operation of the TMS34010 C Compiler

The TMS34010 C Preprocessor (GSPCPP)

Describes GSPCPP's role in macro processing, include files, and conditional compilation.

The TMS34010 Parser (GSPCC)

Explains GSPCC's function in syntax checking and generating intermediate files.

The Code Generator (GSPCG)

Details GSPCG's process of converting intermediate code to assembly source.

Batch Execution of the C Compiler

Explains how to use GSPC.BAT for compiling and assembling C programs.

Linking a C Program

Covers modular code linking, object libraries, and the role of the linker.

The TMS34010 C Language

Identifiers and Keywords

Discusses identifier significance, case sensitivity, and new keywords.

TMS34010 C Data Types

Details basic and derived data types, including enum and void.

Structure and Union Declarations

Explains alignment, bit fields, and member name rules for structures and unions.

Enumeration Declarations

Describes the syntax and usage of named integer constants (enumerations).

TMS34010 C Run-Time Environment

Memory Model

Describes memory organization, including code and data placement.

Register Conventions

Outlines register usage for stack management, function calls, and general operations.

Function Call Conventions

Details how functions pass arguments, handle return values, and manage the stack.

System Initialization

Explains the creation and initialization of the C run-time environment, including stacks.

TMS34010 Run-Time Support

Memory Management

Describes C dynamic memory management routines like malloc, calloc, and free.

String Functions

Lists and describes functions for string manipulation, search, and comparison.

Character Typing and Conversion Macros

Explains macros for identifying character types and converting between cases.

Fatal Errors

Compiler Error Messages

Describes the format and common fatal error messages from the compiler.

Floating Point Facility

Single-Precision Floating-Point Format

Details the 32-bit format for single-precision floating-point numbers.

Double-Precision Floating-Point Format

Details the 64-bit format for double-precision floating-point numbers.

Floating Point Conversions

Explains conversions between integer, float, and double types.

Floating-Point Error Exception Handling

Describes how to trap and handle floating-point errors using fp-error.

Related product manuals