home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!enterpoop.mit.edu!eru.mt.luth.se!kth.se!cyklop.nada.kth.se!d88-jwa
- From: d88-jwa@cyklop.nada.kth.se (Jon Wtte)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Assembly with C question...
- Message-ID: <1992Dec13.214324.22612@kth.se>
- Date: 13 Dec 92 21:43:24 GMT
- References: <1992Dec12.232559.265@physc1.byu.edu>
- Sender: usenet@kth.se (Usenet)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Lines: 35
- Nntp-Posting-Host: cyklop.nada.kth.se
-
- In <1992Dec12.232559.265@physc1.byu.edu> seth@physc1.byu.edu writes:
-
- >My question is, why are all the function calls done in this way? How can I
- >tell what the offset relative to a5 is? I am confused. I have till now only
-
- You can't, since that's the linker's job.
-
- >In the MDS Assembler we always could tell just what our offsets were,
- >becaused we used labels. I don't understand how all these function calls can
-
- You can still use labels, like
-
- jsr Init
-
- as long as Init is extern declared.
-
- >be made with an offset of $0000(a5). Isn't a5 the global area? Why are the
- >function calls going there anyways? Shouldn't they be going to the code area,
- >with offsets relative to the PC? I obviously don't see what is supposed to be
-
- The jump table is loaded relative to A5, and subroutines that aren't
- static are placed in the jump table, so their CODE segments can be
- unloaded.
-
- I further recommend reading up on the Segment Loader in Inside Mac II.
-
- Cheers,
-
- / h+
-
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
-
- Speed is arbitrary. Don't believe me? Try a PowerBook 180 running
- System 7 against a 486 laptop running Windows 3.1.
-