home *** CD-ROM | disk | FTP | other *** search
- *******************************************************************************
- * xmsLib *
- * xms library for TP6.0, Loewy Ron 1991. *
- * Last update : Aug. 11, 1991 *
- *******************************************************************************
-
- Introduction
- ------------
-
- xmsLib implements the XMS 2.0 API for Turbo-Pascal 6.0. This package is
- a first step in a project I took that will allow me to use virtual memory
- references for data in turbo pascal, without the regular limitations of
- 640K. I have used this library in some in house projects, But I would like
- to comment that I have used heavily only the extended memory allocation
- functions. (I have not used the UMB functions). The source of information
- for the XMS API was the XMS specification Ver 2.0 from July 19, 1988,
- published and copyrighted by :
-
- Copyright (c) 1988, Microsoft Corporation, Lotus Development
- Corporation, Intel Corporation, and AST Research, Inc.
-
- Technical documantation
- -----------------------
-
- For technical docs, please refer to the XMS specification published
- by the mentioned companies. I will give a brief explanation of the
- functions defined in the UNIT INTERFACE. A demo test program XMSTEST.PAS
- is included and can be used as a referance for the use of the library.
-
- procedure detectXMS; { look for xms existance, and sets global library variables }
- procedure setXMSHandlerAddress; { determine XMS driver call address }
- procedure getXMSVersionNumber; { get XMS driver version, in XMSVersion, XMMVersion }
- function printXMSVersion : string; { a readable string of the XMS version.. }
- function printXMMVersion : string; { a readable string of the XMM version.. }
- function requestHMA : boolean; { true if request for HMA granted }
- function releaseHMA : boolean; { true if release granted }
- function globalEnableA20 : boolean; { A20 line global enable }
- function globalDisableA20 : boolean; { A20 line global disable }
- function localEnableA20 : boolean; { A20 line local enable }
- function localDisableA20 : boolean; { A20 line local disable }
- function queryA20 : boolean; { true if A20 enabled }
- procedure queryFreeExtendedMemory(var largestBlock, totalInK : word); { return XMS stats. }
- function xmsLargestBlock : word; { return largest available XMB }
- function xmsTotalFreeMemory : word; { returns total free extended memory through XMS driver }
- function allocateXMB(sizeInK : word; var handle : word) : boolean; { allocate XMB }
- function freeXMB(handle : word) : boolean; { free XMB }
- function moveXMB(structure : xmsMovePtr) : boolean; { move memory between XMBs or Main Storage }
- function moveXMBlock(len : longint; srcHandle : word; srcOfs : longint;
- dstHandle : word; dstOfs : longint) : boolean; { calls moveXMB with proper parameters }
- function mainstgToXMB(len : word; fromPtr : pointer;
- toHandle : word; toOfs : longint) : boolean; { 640K memory move to XMB }
- function XMBtoMainstg(len : word; toPtr : pointer;
- fmHandle : word; fmOfs : longint) : boolean; { XMB to 640K normal memory move }
- function lockXMB(handle : word) : boolean; { lock XMB }
- function unlockXMB(handle : word) : boolean; { unlock XMB }
- function getXMBInformation(handle : word; var lockCount, freeHandles : byte;
- var sizeInK : word) : boolean; { return XMB stats }
- function reallocXMB(newSizeInK, handle : word) : boolean; { reallocate XMB }
- function requestUMB(sizeInParagraphs : word; var segmentOfUMB : word;
- var sizeAllocatedOrAvailable : word) : boolean; { request UMB }
- function releaseUMB(segmentOfUMB : word) : boolean; { release UMB }
- function xmsErrorStr : string; { return a string with the XMS error }
-
- Notice : I use the term XMB to describe an eXtended Memory Block, where
- the XMS specification will discribe this block as EMB!.
-
- Warranty
- --------
-
- There is no warranty what so ever, The unit and docs. are supplied as is,
- The author (Loewy Ron), is not, and will not be responsible for any damages,
- lost profits, or inconveniences caused by the use, or inability to
- use this unit. The use of the unit is at your own risk. By using the unit
- you agree to this.
-
- General
- -------
-
- xmsLib is copyrighted by myself, (c) Loewy Ron, 1991. I release
- the source, and it can be used for non-commercial programs, If you find
- xmsLib worthy, and plan to use it in a commercial product - please
- register it. (An order form is supplied - ORDER.TXT)
-
- No one but myself, is allowed to charge money for xmsLib,
- except then minimal distribution fees.
-
-
- Contact
- -------
-
- You can contact me on what-ever you want to at my address at :
-
- Loewy Ron, Loewy Ron
- 9 Haneveem st. Or 20 Smolanskin st.
- Herzeliya, 46465, Haifa, 34366,
- Israel. Israel.
-
- Credits
- -------
-
- Turbo-Pascal is a copyright of Borland International.
-