EasyManuals Logo

Texas Instruments TMS34010 Reference Guide

Texas Instruments TMS34010
181 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 #60 background imageLoading...
Page #60 background image
Runtime
Environment
-
Function
Structure
and
Calling
Conventions
Note:
All integer arguments
are
widened to
32-bit
integers. All
floating-point
arguments
are
cunverted to doubles. All structures that
are
passed
as
ar-
guments
are
rounded up to the next
word
boundary.
5.3.5
Returning
Structures
from
Functions
A special convention applies to functions that return structures. The caller
allocates space
for
the structure, and passes the address
of
the return spar:e
by pushing the address on the stack
just
before calling the function.
To
return
a structure, the called function then copies the structure to the memory block
that the address points to.
This methods allows the caller
to
be smart about telling the called function
where to return the structure. For example, consider the
following
statement:
s=f();
where s
is
a structure and f
is
a function that returns a structure. The caller
can simply push the address
of
s onto the stack and call
f.
Function f then
copies the return structure directly into s, performing the assignment
auto",:
matically.
If
the caller does
not
use
the return value, then it pushes a value
of
0
onto
the
stack instead
of
pushing
an
address. This tells the function not to
copy
the
return structure.
Be
careful
to
properly declare functions that return structures, both when they
are
called (so the caller pushes the address correctly) and when they
are
de-
fined (so the function knows where
to
copy the reSUlt).
5-11

Table of Contents

Other manuals for Texas Instruments TMS34010

Questions and Answers:

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
BrandTexas Instruments
ModelTMS34010
CategoryComputer Hardware
LanguageEnglish

Related product manuals