Zilog ZUSBOPTS Bedienungsanleitung Seite 203

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 520
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 202
UM017105-0511 Calling Assembly Functions from C
Zilog Developer Studio II – ZNEO™
User Manual
175
Argument Locations
The assembly function assigns the location of the arguments following the C calling con-
ventions as described in the Calling Conventions
section on page 172. For example, if you
are using the following C prototype:
void myfunc(short arga, long argb, short *argc, char argd, int
arge, int argf, char argg, long *argh, int argi)
then the location of the arguments are:
arga: R1
argb: R2
argc: R3
argd: R4
arge: R5
argf: R6
argg: R7
The remaining arguments are on stack, and their offsets from Stack Pointer (SP, R15) at
the entry point of assembly function are:
argh: -4(SP)
argi: -8(SP)
The corresponding offsets from Frame Pointer (FP, R14) after a
Link #0 instruction are:
argh: -8(FP)
argi: -12(FP)
Return Values
The assembly function returns the value in the location as specified by the C calling con-
vention as described in Calling Conventions
on page 172.
For example, if you are using the following C prototype:
long myfunc(short arga, long argb, short *argc)
then the assembly function returns the long value in register R0.
Seitenansicht 202
1 2 ... 198 199 200 201 202 203 204 205 206 207 208 ... 519 520

Kommentare zu diesen Handbüchern

Keine Kommentare