Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!nsc!voder!apple!landon From: landon@Apple.COM (Landon Dyer) Newsgroups: comp.sys.mac.programmer Subject: 32K global data limit in MPW Message-ID: <11064@apple.Apple.Com> Date: 26 May 88 16:23:22 GMT Organization: Apple Computer Inc, Cupertino, CA Lines: 32 > ... The MPW implementation is pretty > much the same as the UNIX implementation, except the *stupid* compiler > and the *stupid* linker will not allow more than 32k of global data. > ... > > I didn't realize this until trying to link Flex, but a maximum of > 32k for global data in a real program is *stupid* (imagine the word > *stupid* in bold, italic, shadowed style of the system font, size 24). > Get with it, Apple. The Mac architecture uses the 32K "below" A5 to hold global data. 16-bit register-relative references are much cheaper than any kind of 32-bit reference, which probably made a big difference in what would fit into the 128K RAM available on the original Mac. The current compilers generate 16-bit A5-relative references to global data. The code generation imposes the 32K limit; the linker doesn't have much to do with it. The Pascal and C compilers in the Beta release of MPW 3.0 will have options to generate 32-bit A5-relative references to global data. Since the 68000 doesn't have a corresponding addressing mode, several instructions must be generated for each data reference. It's rather expensive, but it may help you get ported software off the ground. Again: If you have more than 32K of global data, chances are that you're doing something wrong. -Landon -- I speak for me.