3 ms·
Classic Mac used this for some toolbox traps as well. Most apps used a jump table at some offset from the A5 register, which looked like: addr: _LoadSeg
by cancerhacker 3y ago
Classic Mac used this for some toolbox traps as well. Most apps used a jump table at some offset from the A5 register, which looked like:
addr: _LoadSeg
dc.w segmentNumber
dc.w segmentOffset
The _LoadSeg trap would ensure that 'CODE'(segmentNumber) was loaded from disk and then modify the jump code @addr to become an absolute JMP (0x4ef9 + 32 bits) and then set the PC back to @addr and return from the trap. There was also an _UnloadSeg mechanism that would reverse this!