Important: The information in this document is obsolete and should not be used for new development.
Chapter 8 - Trap Manager
This chapter describes how your application can use the Trap Manager to augment or override an existing system software routine.Although this chapter describes patching in some depth, you should rarely, if ever, find a need to use patches in an application. The primary purposes of patches, as their name suggests, are to fix problems and augment routines in ROM code.
To use this chapter, you should have some knowledge of assembly language. For information about the instruction sets of microprocessors in the Motorola MC680x0 family, see the appropriate user's manual, for example, the MC68020 32-Bit Microprocessor User's Manual.
This chapter describes how the Trap Manager works and then shows how you can use the Trap Manger to
- check for the availability of a system software routine
- alter the behavior of a system software routine
Chapter Contents
- About the Trap Manager
- Trap Dispatch Tables
- Process for Accessing System Software Routines
- Patches and System Software Routines
- Daisy Chain of Patches
- Head Patch (Normal Patch)
- Tail Patch
- Come-From Patch (Used Only by Apple)
- Patch for One Application
- Patch for All Applications
- A-Line Instructions
- A-Line Instructions for Operating System Routines
- Calling Conventions for Register-Based Routines
- Parameter-Passing Conventions for Operating System Routines
- Function Results
- Flag Bits
- A-Line Instructions for Toolbox Routines
- Calling Conventions for Stack-Based Routines
- Parameter-Passing Conventions for Toolbox Routines
- Function Results
- The Auto-Pop Bit
- About Trap Macros
- About Routine Selectors
- Using the Trap Manager
- Determining If a System Software Routine is Available
- Patching a System Software Routine
- Trap Manager Reference
- Routines
- Accessing Addresses From the Trap Dispatch Tables
- Installing Patch Addresses Into the Trap Dispatch Tables
- Detecting Unimplemented System Software Routines
- Manipulating One Trap Dispatch Table (Obsolete Routines)
- Summary of the Trap Manager
- Pascal Summary
- Constants
- Data Types
- Routines
- C Summary
- Constants
- Data Types
- Routines
- Assembly-Language Summary
- Constants
- Trap Macros