[comp.lang.pascal] Is it possible to use extended memory with Turbo

phys169@csc.canterbury.ac.nz (01/30/91)

In article <25746@adm.brl.mil>, GRAD205%BRFUEM.BITNET@uicvm.uic.edu ( Humberto) writes:
>    I would like to know if is possible to use extended memory with Turbo
> Pascal 5.0.
>    I have an IBM-PC 386 with 4 mb of memory and I would like to    store
> an array or a field of pointers in this memory ...
> 
You need to use a bit of assembler (or at least an intr($15,reg) call), which
is pretty easy from within Turbo Pascal. There are no built-in routines, nor
example programs to help you though (there is an example of EMS memory use),
so at the very least look at Ralf Brown's interrupt list, but best talk to
someone familiar with the ins and outs of such things (e.g. if you are storing
data collected in real time, you will have to run with interrupts disabled
when transferring data between extended and conventional memory areas, which
can be a problem; besides, any assembly language stuff needs a good amount of
care and debugging anyway). 

Notice, this assumes you will simply transfer chunks of memory in and out of
the space used by Turbo Pascal, and assumes no other program is using extended
memory.  If some extended memory is used for a RAMDISK, for example, it gets
much more difficult (Microsoft published a standard way for applications to
tell what extended memory is being used - but some programs ignore it - even
a Microsoft one, I'm told!).  If you have difficulty, consider either:
(a) using the memory for a RAMDISK, and using conventional file i/o to access
    that, or
(b) get an EMS simulator (e.g. EMSIM, or the special 386 software with DRDOS 5)
    that makes extended act as expanded, then use the nice management tools
    you get with EMS.
(c) hunt through sample source programs for helpful code. If you have ftp
    access from your computer, consider simtel and uwasa (128.214.12.37)
    archives. Such sites often have lists and frequently-asked-questions files
    to make your search a bit easier.

Mark Aitchison, Physics, University of Canterbury, New Zealand. 

achristo@ulrik.uio.no (Alf Christophersen) (02/01/91)

I got a letter from Turbo Power today and they tell that in Object Professional
1.10 you will find routines for handling EMS and XMS.

They also announce a new package called TSRs Made Easy. That also include
routines for handling EMS and XMS. 

How any of these routines works, I have no idea since I haven't ordered them
yet. Most of interesert to me is the program Analyst which they announce
in version compatible with TP 6.0.

Alf Christophersen
Dep. of Nutrition Research
University of Oslo
Po Box 1046, Blindern
N-0316 Oslo 3
Norway