Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Mac OS Runtime Architectures /
Chapter 11 - Classic 68K Runtime Conventions / Classic 68K Stack Structure and Calling Conventions


Register Preservation

Table 11-2 lists registers used in the classic 68K runtime environment and their volatility in routine calls. Registers that retain their value after a routine call are called nonvolatile. Note that these register conventions are for C and Pascal-style calls. Certain system calls may use different conventions, so you should check their definitions in the appropriate Inside Macintosh book before using them. All registers are 4 bytes long.
Table 11-2 Volatile and nonvolatile registers
TypeRegisterPreserved by a
function call?
Notes
Data registerD0 through D2No 
 D3 through D7Yes 
Address registerA0No 
 A1No 
 A2 through A4Yes 
 A5See noteUsed to access global data objects and the jump table.
 A6YesUsed as the frame pointer, which points to the base of the stack frame.
 
 A7See noteA7 is the stack pointer used to push and pop parameters and other temporary data items.
Floating- point registerF0 through F3NoWhen present.
 F4 through F7YesWhen present.
Condition RegisterCRNoBits are set by compare instructions and used for conditional branching.

Appendixes


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 MARCH 1997