Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!rutgers!dayton!rosevax!sds!dave From: dave@sds.UUCP (dave schmidt x194) Newsgroups: comp.lang.c,comp.sys.ibm.pc,comp.sys.intel Subject: Re: C compilers that can access more memory Message-ID: <415@sds.UUCP> Date: Fri, 12-Jun-87 14:44:44 EDT Article-I.D.: sds.415 Posted: Fri Jun 12 14:44:44 1987 Date-Received: Sat, 20-Jun-87 19:02:42 EDT References: <496@tahoe.UUCP> <161@edm.UUCP> Organization: SciCom Data Services, Minnetonka, MN Lines: 27 Keywords: More C Memory Xref: mnetor comp.lang.c:2506 comp.sys.ibm.pc:4879 comp.sys.intel:269 In article <161@edm.UUCP>, usenet@edm.UUCP (usenet control) writes: > In article <496@tahoe.UUCP>, malc@tahoe.UUCP (Malcolm L. Carlock) writes: > > I'm looking for a C compiler to run on '286 AT's or AT clones that can > > access more than 64K of program and 64K of data memory. Microsoft C.... > > I believe that Microsoft (at least) has flags for use of the -l(arge) and > -m(edium) memory models. These should allow the use of >64k total, ... Yes, medium model allows you multiple code segments and large model allows for multiple data and code segments, allowing your programs to access >64K of data and code. There is also a compact model (in 4.00 anyway) that has one code segment and multiple data segments. > ... but you are still limited to 64k in any given array/object. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This limitation can be circumvented by using the "huge" model that MSC provides (this model may not exist prior to v. 4.00, I don't know). As I recall, in the huge model arrays may be of any size that will fit in memory as long as each array element is smaller than 64K. Also, you can use huge data elements in any model that you want -- declare your pointers as "huge" (e.g., char huge *hugeptr;) and point them at memory obtained from halloc(). You should be aware that halloc() is a trifling restrictive in that if the size of the requested array is >128K, then the size of an array element must be a power of 2. Memory obtained from halloc() may be freed via hfree(). See the manual for more info.