Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!iuvax!bobmon From: bobmon@iuvax.cs.indiana.edu (RAMontante) Newsgroups: comp.lang.c Subject: Re: Different pointer representations on the same machine Message-ID: <17683@iuvax.cs.indiana.edu> Date: 17 Feb 89 04:45:04 GMT Reply-To: bobmon@iuvax.cs.indiana.edu (RAMontante) Organization: malkaryotic Lines: 24 (Apologies to flat-address_space fans and C purists...) [ Wade Guthrie asks for examples of computers using different representations for different pointer types. Then... ] gregg@ihlpb.ATT.COM (Wonderly) <9626@ihlpb.ATT.COM> : -The middle model of the typical 80x86 C compiler is a great example. -Typically, pointers to text are FAR (selector/segment plus offset) while -pointers to data are NEAR (just offset). While there is not a model -(that I have seen) that is the other way, it is a conceivable alternative. As a matter of fact, the "conceivable alternative" (called Compact in TC), is the one that makes sense to me. Most of the interesting programs I write need less than 64K of text to massage a couple hundred kilobytes of arrays (all the array I can fit into memory). I've never even used the medium model. The oft-maligned NEAR/FAR keywords in the MSC and TC compilers exist to facilitate linking modules that are compiled in different models -- this is a case of having to cope with different representations for the _same_ types of pointers. (Although prototyping avoids some goofups, and the rest usually -- not always -- turn up as linker errors.) -- "Aren't you sorry you didn't hit 'n'?"