Accessing Parameters; Table 2.4: Determination Of Argument Size - Texas Instruments TI-89 Software Manual

Sierra c assembler
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

78
Compiler and Flags
com68
com68 -Os2
com68 -Os3
com68 -Os4
com68 -Os5
com68 -XI
com68 -XI -Os2
com68 -XI -Os3
com68 -XI -Os4
com68 -XI -Os5
Note:Sizes are in bytes, with and without prototype — (with prototype) / (without prototype).
The TI-89 / TI-92 Plus requires use of the LXI flag.
Table 2.4 shows the sizes in bytes that function arguments occupy on the stack.
The sizes are shown as a function of the compiler and associated command line
flags, argument type, and whether or not a prototype is present. The numbers in
the table to the left of the slash ( / ) are sizes in bytes in the presence of a
prototype; the numbers to the right are sizes in the absence of a prototype.
2.11.3.

Accessing Parameters

Inside the called function, the function parameters are accessed from the stack.
The exact mechanism for accessing the parameters is determined by the
presence or absence of the link and movem instructions.
The link instruction, if present, is the first instruction in a function; it is used to set
up a stack frame using address register a6 as the frame pointer (refer to the link
instruction in the M68000 Family Programmer's Reference Manual ). The link
instruction is also used to leave an extra four bytes free on the top of the stack.
When the top of the stack is free, the rightmost parameter in a function call can
be moved onto the stack instead of pushed onto the stack. The default action is
to use a link instruction only when a stack variable is referenced while the stack
is temporarily displaced, or when the program is to be examined with a
source-level debugger. Its use can be forced with the -Of1 command line flag.
When the link instruction is not used and a function parameter expects the top of
the stack to be free a subq.l #4, sp instruction is inserted at the start of the
function to free up the top of the stack.
The movem instruction (move or movea instruction if only one register is saved)
saves on the stack the registers that must remain unmodified across a function
TI-89 / TI-92 Plus Sierra C Assembler Reference Manual
char
short
2 / 4
2 / 4
4 / 4
2 / 4
2 / 4
4 / 4
2 / 4
2 / 4
4 / 4
4 / 4
4 / 4
4 / 4
4 / 4
4 / 4
4 / 4
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2
2 / 2

Table 2.4: Determination of Argument Size

Not for Distribution
int
long
float
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
4 / 4
10 / 10
Section 2: Compiler
double
10 / 10
10 / 10
10 / 10
10 / 10
10 / 10
10 / 10
10 / 10
10 / 10
10 / 10
10 / 10
Beta Version February 2, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-89 plusTi-92 plus

Table of Contents