Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!sdd.hp.com!usc!wuarchive!psuvax1!swatsun!news From: res90@campus.swarthmore.edu Newsgroups: comp.sys.mac.programmer Subject: Re: MPW segmentation Message-ID: Date: 27 Jul 90 19:36:19 GMT Sender: news@cs.swarthmore.edu (Usenet) Organization: Swarthmore College Lines: 40 I recieved several answers to my posting. >I have been getting an error message 50 during linking. >Jump table offset into code greater than 32K > >I can't figure out what's up. Can anyone give me a hint. > And a few requests for the answer. So if anyone is interested here goes. My problem came about because I was not segmenting my code. The default in MPW is to toss everything in one segment Main. Once this segment got above 32K I began to have trouble. The size problem alone can be corrected by using the -ss link option, but it turns out that there is a more fundemental problem in the jump offset. A function cannot begin at a location more than 32K into the code, because the jump-table entry is a signed 16-Bit value. In my case this whole mess could be solved by segmenting my code. Which turns out to be really trivial. In c #pragma segment name1 the code to go in segment name1 #pragma segment name2 the code to go in segment name2 will place all the code following the #pragma segment name1 statement in a segment named name1, etc. This is explained well on page 11 of the MPW c manual. In pascal i'm told, though I have not tested it, that {$S name1} will do the trick. There is i'm told some art to segmenting code. This is still lost on me but #pragma has kept me up and running. Thanks To everyone Rob Smith Swarthmore College Bitnet: RES90@SWARTHMR Internet : RES90@CAMPUS.SWARTHMORE.EDU