Path: utzoo!attcan!uunet!snorkelwacker!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: CODE 0 resource Message-ID: <9718@goofy.Apple.COM> Date: 13 Aug 90 16:33:28 GMT References: Organization: Apple Computer Inc., Cupertino, CA Lines: 40 In article J. Joshua writes: >Could someone please give me the layout of a CODE 0 resource? Do the >first few bytes mean anything or is the whole thing just one big jump >table? According to the Segment Loader chapter of Inside Mac, volume II: 4 bytes "above A5" size in bytes from where A5 points to the top of the application space 4 bytes "below A5" size in bytes of application globals plus QuickDraw globals 4 bytes length of jump table 4 bytes offset to jump table relative to A5 n bytes jump table (list of 8 byte entries) An entry in the jump table will be in one of two states depending on if its segment is loaded or not: "unloaded" 2 bytes routine's offset relative to the start of the segment 4 bytes MOVE.W #segmentNumber,-(SP) instruction 2 bytes _LoadSeg trap ($A9F0) "loaded" 2 bytes segment number 6 bytes JMP routine'sAbsoluteAddress instruction steve -- ____________________________________________________________________ Steve Christensen Internet: stevec@goofy.apple.com Apple Computer, Inc. AppleLink: STEVEC 20525 Mariani Ave, MS 81-CS CompuServe: 76174,1712 Cupertino, CA 95014 "You just contradicted me." "No I didn't." ____________________________________________________________________