Function results are returned in the accumulator ( rst register), if they t in the register. Methods calls (from either objects or clases) have an additional invisible parameter which is self. This parameter is the leftmost parameter within a method call (it is therefore the last parameter passed to the method).
When the procedure or function exits, it clears the stack.
Other calling methods are available for linking with external object les and libraries, these are summarized in table (6.3). The rst column lists the modi er you specify for a procedure declaration. The second one lists the order the paramaters are pushed on the stack. The third column speci es who is responsible for cleaning the stack: the caller or the called function. The alignment column indicates the alignment of the parameters sent to the stack area. Finally, the fth column indicates if any registers are saved in the entry code of the subroutine.
|
More about this can be found in chapter 7, page 352 on linking. Information on GCC registers saved, GCC stack alignment and general stack alignment on an operating system basis can be found in Appendix I. As of version 2.0 (actually, in 1.9.x somewhere) , the register modi er is the default calling convention, prior to that, it was the oldfpcall convention.
The default calling convention, i.e., the calling convention used when none is speci ed explicitly, can be set using the f$calling g directive, section 1.1.5, page 36
Remark: The popstack modi er is no longer supported as of version 2.0, but has been renamed to oldfpcall. The saveregisters modi er can no longer be used.