Important: The information in this document is obsolete and should not be used for new development.
Direct and Indirect Calls
A direct call does not require switching of the direct data area since it makes use of the calling party's direct data area by default. A direct assembly-language call to the functionmooFunc
would simply be
BSR.L _$mooFuncwhere_$mooFunc
signifies the internal entry point ofmooFunc
.
To allow the switching of the direct data area, the CFM-68K runtime architecture specifies that a procedure pointer points to a transition vector.
- IMPORTANT
- When discussing routine calls and the direct data area switching method, the external entry point refers to the entry point of the routine when called indirectly through a transition vector. A direct (in-fragment) call enters a routine through the internal entry point.
All indirect or cross-fragment calls go through a transition vector. The fragment uses the code and data world pair to set up a direct data area associated with the called routine. An indirect call to the function
mooFunc
would be as follows:
MOVE.L _@mooFunc,A1; load transition vector into A1 MOVE.L (A1)+, A0 ; get code address JSR (A0) ; make the call MOVE.L "lcl", A5 ; restore A5 from "cl" ; after the call.The term "lcl
", which can be either a memory-based load variable or a register variable, is the location where the procedure saved its own A5 value prior to the call.
- Note
- Unlike the PowerPC case, glue code in the called routine is responsible for switching the direct data area in CFM-68K. However, the other actions of the caller's code (loading the transition vector into a register, calling the routine, and restoring the base register after the call) are identical.