Zilog ZUSBOPTS Manuel d'utilisateur Page 202

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 520
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 201
Calling Assembly Functions from C UM017105-0511
174
Zilog Developer Studio II – ZNEO™
User Manual
Special Cases
Some function calls do not follow the mechanism described in the Function Call Mecha-
nism section on page 172. Such cases are described in this section.
Returning Structure
If the function returns a structure, the caller allocates the space for the structure and then
passes the address of the return space to the called function as an additional and first argu-
ment. To return a structure, the called function then copies the structure to the memory
block pointed to by this argument.
Not Allocating a Local Frame
The compiler does not allocate a local stack frame for a function in the following case:
The function does not have any local stack variables, stack arguments, or compiler-
generated temporaries on the stack
and:
The function does not return a structure
and:
The function is compiled without the debug option.
Calling Assembly Functions from C
The ZNEO C-Compiler allows mixed C and assembly programming. A function written in
assembly can be called from C if the assembly function follows the C calling conventions
as described in the Calling Conventions
section on page 172.
This section covers the following topics:
Function Naming Convention
Argument Locations
Return Values
Preserving Registers
Function Naming Convention
Assembly function names must be preceded by an underscore ( _ ). The compiler prefixes
the function names with an underscore in the generated assembly. For example, a call to
myfunc() in C is translated to a call to _myfunc in assembly generated by the compiler.
Vue de la page 201
1 2 ... 197 198 199 200 201 202 203 204 205 206 207 ... 519 520

Commentaires sur ces manuels

Pas de commentaire