This wiki is being migrated to http://www.github.com/z88dk/z88dk/wiki

 

Differences

This shows you the differences between two versions of the page.

temp:front [2020/04/20 21:40]
dom
temp:front [2020/04/20 21:44] (current)
dom
Line 202: Line 202:
Function call linkage can be found on the new wiki: https://github.com/z88dk/z88dk/wiki/CallingConventions Function call linkage can be found on the new wiki: https://github.com/z88dk/z88dk/wiki/CallingConventions
- 
-This is a technical subject probably only of interest to assembly language programmers and can safely be skipped. 
- 
-Function call linkage refers to how the compiler communicates function parameters to- and return values from- a called function. 
- 
-==== Parameter Passing ==== 
- 
-Calls through function pointers always use standard linkage. 
- 
-All functions in the new C library make use of the quicker & smaller fastcall or callee linkage as do most functions in the classic C library. When C library functions are assigned to a function pointer, the function pointer is assigned an entry point that uses standard linkage. 
- 
-Fastcall and callee linkage were originally added to sccz80 to efficiently call library functions written in assembler.  sdcc added these calling conventions for compatibility with z88dk's libraries. sccz80 is capable of generating callee code. Both sccz80 and sdcc are capable of generating fastcall C code.  So if your C code takes just one parameter, sdcc will compile better linkage if the C function has the "%%__z88dk_fastcall%%" decoration added to the end of the function signature. There is a noticeable improvement in the code generated by sdcc for fastcall functions particularly for small functions.  Keep in mind that sdcc may have trouble calling fastcall functions by function pointer -- it can only generate code for this if it is allowed to use the iy register.  The C library has a different method for resolving this that allows all library functions, standard / fastcall / callee, to be called seemlessly via function pointer. 
- 
-More details can be found in the [[front#mixing_c_and_assembly_language|Mixing C and Assembly]] topic. 
===== Limitations ===== ===== Limitations =====
 
temp/front.txt · Last modified: 2020/04/20 21:44 by dom
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki