home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 19771 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  1.6 KB

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