Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!ews00461 From: ews00461@uxa.cso.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: CODE segments Message-ID: <227700050@uxa.cso.uiuc.edu> Date: 10 Nov 89 10:32:24 GMT Lines: 23 Nf-ID: #N:uxa.cso.uiuc.edu:227700050:000:1055 Nf-From: uxa.cso.uiuc.edu!ews00461 Nov 9 10:27:00 1989 I find the discussion of segmentation very interesting, and I have a few questions which are probably more basic... Suppose I was going to write a compiler for the Mac. My understanding of what this beast should finally create is this: The output would perhaps be a file of type APPL with a number of CODE segments (among a few other things). The CODE segments themselves are of interest to me. Such CODE segments should contain completely relocateable code. All global variables should be reference from A5, (where does A5 get set?). All local variables should be on the stack. All jumps should be relative, if they are in the same segment, and should go through the jump table if they are to another segment (how is this done, I assume there is a toolbox call to do this?) There must be at least 2 (?) segments, 1 jump and 1 with real code. Any insight into this whole area would be very interesting. And obviously, there are a few people on this net for whom this is trivial. Any wisdom to pass on ? Eric W Sink ews00461@uxa.cso.uiuc.edu