User`s guide

C for DSP56800E
Calling Conventions and Stack Frames
115Targeting MC56F83xx/DSP5685x Controllers
Table 6.2 shows the sizes and ranges of the floating-point types.
Calling Conventions and Stack Frames
The DSP56800E compiler stores data and call functions differently than does the
DSP56800 compiler. Advantages of the DSP56800E method include: more registers
for parameters and more efficient byte storage.
Passing Values to Functions
The compiler uses registers A,B, R1, R2, R3, R4, Y0, and Y1 to pass parameter
values to functions. Upon a function call, the compiler scans the parameter list from
left to right, using registers for these values:
The first two 16-bit integer values — Y0 and Y1.
The first two 32-bit integer or float values — A and B.
The first four pointer parameter values — R2, R3, R4, and R1 (in that order).
The third and fourth 16-bit integer values — A and B (provided that the compiler
does not use these registers for 32-bit parameter values).
The third 16-bit integer value — B (provided that the compiler does not use this
register for a 32-bit parameter value).
The compiler passes the remaining parameter values on the stack. The system
increments the stack by the total amount of space required for memory parameters.
This incrementing must be an even number of words, as the stack pointer (SP) must be
continuously long-aligned. The system moves parameter values to the stack from left
to right, beginning with the stack location closest to the SP. Because a long parameter
must begin at an even address, the compiler introduces one-word gaps before long
parameter values, as appropriate.
Table 6.2 M56800E Floating-Point Types
Type Size
(bits)
Range
float 32 1.17549e-38 to 3.40282e+38
short double 32 1.17549e-38 to 3.40282e+38
double 32 1.17549e-38 to 3.40282e+38
long double 32 1.17549e-38 to 3.40282e+38