Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site Shasta.ARPA Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!glacier!Shasta!gus From: gus@Shasta.ARPA Newsgroups: net.micro.mac Subject: Re: Megamax C problems Message-ID: <22@Shasta.ARPA> Date: Fri, 31-Jan-86 13:49:03 EST Article-I.D.: Shasta.22 Posted: Fri Jan 31 13:49:03 1986 Date-Received: Sat, 1-Feb-86 21:27:18 EST References: <155@axiom.UUCP> Organization: Stanford University Lines: 28 > > > miles@siemens.UUCP writes: > >successfully run on UNIX. After compiling the modules without error I > >get an error from the Megamax linker that reads: > > Segment 'main' > 32K > > Press RETURN to continue > > Because of the way the Macintosh Segment Loader works (2 bytes offset > in jump tables), mac code segments are limmited to 32K. I think that you will > find that ALL Mac C compilers, will have the same complaint. Popycock! The 32K byte segment limit has little to do with the jump table. It is easy for a linker to provide a secondary jump table at the start of the segments which provides four byte offsets. The main problem has to do with the 68000's 16 bit offset addressing modes. The SUMACC C compiler produces 32 bit absolute code. This requires an extra relocation phase, but it does allows large model code. At a Stanford Mac Users Group Developers meeting last fall, Jim Goodnow II, the creator of Mac Aztec C, told us that he was working on a compiler which could create large model code. Also, 32K is simply the limit for GUARANTEED addressability. It just means that one part of the code cannot reference code or data which is more than +/- 32K away. This is hard for a compiler to take advantage of, however. G U S