SDKZSPF LSI, SDKZSPF Datasheet - Page 68

no-image

SDKZSPF

Manufacturer Part Number
SDKZSPF
Description
Manufacturer
LSI
Datasheet

Specifications of SDKZSPF

Lead Free Status / Rohs Status
Supplier Unconfirmed
3.2.7 Parameter Passing Examples
3.2.7.1 sdcc/zdxcc
3-14
mov
add
stdu
mov
add
stdu
mov
ldx
mov
ldx
mov
ldx
mov
ldx
add
popd
popd
mov.e
popd
ret
The appropriate epilogue code for the above prologue is shown below.
a7, 20
a2, a7
r8, a7
%rpc, r8
r8, a7
In the example below, function foo calls function bar, passing two long
(32-bit) arguments from r1r0 and r3r2. The first argument is placed in the
stack at r12 + 1, and the second argument is placed at r12 + 3.
Function bar has a frame size of 16 and accesses the passed
arguments in function foo’s outgoing argument stack space.
The function bar retrieves arguments from foo’s stack space by loading
the values from foo’s outgoing argument space. The first word of foo’s
outgoing arguments is located at r12+(bar’s stack space)+1, or
r12+(16)+1.
C Cross Compiler
Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved.
r13, 1
r13, r12
r0, r13, 2
r13, 3
r13, r12
r2, r13, 2
r13, 17
r0, r12
r13, 18
r1, r12
r13, 19
r2, r12
r13, 20
r3, r12
!! The first argument location on the stack
!! Store r0 at r12+1 and r1 at r12+2.
!! Compute r12+3 and store in r13.
!! Store r2 in r12+3 and r3 in r12+4.