hutzley@bigq.dec.com (Steve Hutzley) (11/07/90)
>Article 1718 >From: Duel@cup.portal.com (Omid M Farr) >Newsgroups: comp.os.msdos.programmer >Subject: using extended memory for arrays [??] >Date: 3 Nov 90 23:29:39 GMT >Organization: The Portal System (TM) >I'm using Borland's TC++ and would like to know how I can get the compiler >to use extended memory for strings, variables, and arrays. (No executeable >code). As it is, if I allocate a one or two meg array, it will compile and >end up as a 1-2 meg file which obviously wont fit into the 640k base memory. >Can someone give me an example or tell me how I can load in a 1-2 meg file >which holds all the array data and then have the program actually access this >memory. >Since this program continually manipulates data, it is not efficient to >continously load strings from the hard drive. I could use a ramdrive, but >there must be an quicker and less "clumsy" method. >Thanks.. any examples or information on how (if possible) this can be done. [[ I appoogize for the full quote, but I felt it was needed here]] TC++ does support overlays, and that may work, but it will more that likely cause ALOT of disk activity. Another route would be to get hold of some expanded/extended memory routines. I have seen shareware as well as "consumer" type libraries that will manipulate exp/ext mem. If you don't mind playing with DOS functions, the INT21 functions up in the 0x60 range do memory functions (if memory serves me correctly, I don't have exp/ext mem. so I have never played with them) Any one else? Steve
dave@interlan.interlan.com (Dave Goldblatt) (11/09/90)
Borland's VROOMM overlay system will use the disk, expanded, or extended memory to swap CODE only. It will NOT swap data. That's an entirely different beastie. VROOMM will automagically detect what sort of memory is available, and swap to that accordingly. I think it checks for expanded first, then extended, and then if neither is found, it will use the disk (swapping out of the executable, not a temp file!). Moral of the story: If you want to use expanded or extended memory for data, you have to write your own routines to deal with swapping the various pages, etc. Microsoft will send you the specs and a driver for the XMS method of allocating and accessing extended memory, including using the normally inaccessible 64K area way up at the top of memory at no charge; just call their 800 # and ask for it. (aka HIMEM.SYS) There are a number of commercial and shareware packages to do expanded and extended memory management, but I've never really done more than glance over them (I tend to roll my own routines). Good luck. -dg- -- "You can twist perceptions * Dave Goldblatt dave@interlan.com Reality won't budge..." * Diagnostic Engineering - Rush * Racal InterLan * Boxborough MA (508) 263-9929