home *** CD-ROM | disk | FTP | other *** search
-
-
- Expanded Memory Interface Library
- Copywrite (c) 1988 Shamaal Software
- Written by : Donley R. P'Simer
-
- The file SEMS.LIB contains MSC v5.0 compatible routines that
- allows the C programmer to access Expanded memory under the LIM Expanded
- Memory specification.
-
- LICENSE
-
- You are hereby authorized to freely copy and distribute this
- ARCfile in an unmodified form.
- You are authorized to use the functions contained in the
- library without giving any credit to me (Donley P'Simer) or to
- Shamaal Software. These routines are simple and were easy to write.
- I am offering this library for your convenience only.
-
- DISCLAIMER
-
- Neither I (Donley P'Simer) nor Shamaal Software are liable
- for any damages resulting from the use of this library.
- If you break this code you have both pieces.
-
- DONATIONS
-
- If you find these function useful and would like to express
- your appreciation in a monetary form, please make checks payable to:
- ($5 seems appropriate)
-
- Donley R. P'Simer
- 1045 Kalmia ave.
- Boulder, Colorado 80302
-
- please include a note telling me why you are sending me money.
-
- SUPPORT
-
- Since this is PUBLIC DOMAIN software I will not promise any
- support for these functions, but if you have problems with them feel
- free to send me NETMAIL at 104/63 or leave me mail on:
-
- Into The Wind BBS (104/63) -- (303)-939-9272
- 300/1200/2400 baud N81
-
- if I have time I will be more than happy to help you with any
- problems you may have with these functions. Your constuctive
- criticism will be greatly appreciated.
-
- REFERENCE
-
- Global Vars:
-
- unsigned char EMSVer --- Contains the Version of the EMM
- software in BCD format.
- unsigned char emserr --- Contains the Last error reported by
- the EMM.
- unsigned EMSPgFrm --- Contains the address of the EMS page
- frame segment.
- unsigned EMSPgNum --- Contains the total number of logical pages
- in the system.
- unsigned EMSAvail --- Contains the Number of logical pages
- currently available.
-
- EMS Functions :
-
-
-
- unsigned emsavail();
-
- Description :
-
- Determines if there is an EMM installed in the computer
- system. You must call this function before any other in this
- library. I have not added enough error checking to the other
- routines to stop them from calling the EMM interrupt if
- there is no EMM present. If your program calls the other
- functions when there is no EMM present unpredictable things
- will happen.
-
- Returns :
-
- emsavail() returns NOEMS if there is no EMM otherwise
- proceed.
-
-
-
-
- unsigned char emsinit();
-
- Description :
-
- Initializes all global variables.
-
- Returns :
-
- error code as described in emslib.h.
-
-
-
- unsigned char emstat();
-
- Description :
-
- Test's whether the expanded memory hardware is
- functional.
-
- Returns :
-
- error code as described in emslib.h
-
-
-
- unsigned emspgfrm();
-
- Description :
-
- Gets the adress of the page frame segment from the EMM.
-
- Returns :
-
- the page frame adress. If (emserr != NOERR) then this
- function returns an error code as described in emslib.h.
- this error code will be the same as the contents of emserr.
-
-
-
- unsigned emspages();
-
- Description :
-
- This function sets the variables EMSAvail and EMSPgNum to
- their appropriate values.
-
- Returns :
-
- error code as described in emslib.h.
-
-
-
- unsigned char _emsopen(pgs)
- unsigned pgs; --- Number of pages to allocate to
- handle.
-
- Description :
-
- Instructs the EMM to allocate (pgs) number of logical
- pages for the calling application.
-
- Returns :
-
- If (emserr != NOERR) then this function returns an error
- code as described in emslib.h, otherwise it returns a handle
- for the program to use in any further references to the
- memory it has requested.
-
-
-
- unsigned char _emsmap(physpg,logpg,hand)
- unsigned physpg; --- Physical page.
- unsigned logpg; --- Logical page.
- unsigned char hand; --- EMM handle.
-
- Description :
-
- This function instructs the EMM to map the logpg belonging
- to handle into physical page physpg.
-
- Returns :
-
- error code as described in emslib.h.
-
-
-
- unsigned char _emsclose(hand)
- unsigned char hand; --- EMM handle.
-
- Description :
-
- Realeases all EMS memory owned by handle.
-
- Returns :
-
- error code as described in emslib.h.
-
-
-
- unsigned char minver();
-
- Description :
-
- Gets the minor version number of the EMM software.
- emsinit() must have been called previously.
-
- Returns :
-
- The minor verion number of the EMM software.
-
-
-
- unsigned char majver();
-
- Description :
-
- Gets the major version number of the EMM software.
- emsinit() must have been called previously.
-
- Returns :
-
- The major verion number of the EMM software.
-
-
-
- unsigned char emssvmap(hand)
- unsigned char hand; --- EMM handle.
-
- Description :
-
- Saves the current mapping context. This routine is for
- TSR's and interrupt handlers that use expanded memory.
-
- Returns :
-
- error code as descibed in emslib.h
-
-
-
- unsigned char emsrsmap(hand)
- unsigned char hand; --- EMM handle.
-
- Description :
-
- Restores mapping context previously save with the
- emssvmap() function. Again, this routine is for TSR's and
- interrupt handlers that use expanded memory.
-
- Returns :
-
- error code as described in emslib.h
-
-
-
- unsigned char emshnum();
-
- Description :
-
- Gets the total number of handles using Expanded memory.
-
- Returns :
-
- if (emserr != NOERR) this function returns an error code
- otherwise it returns the number of active handles using
- expanded memory.
-
-
-
-
- unsigned emspgnum(handle)
- unsigned char handle; --- EMM handle.
-
- Description :
-
- Gets the number of pages owned by 'handle'.
-
- Returns :
-
- if (emserr != NOERR) this function returns an error code
- otherwise it returns the number of pages owned by 'handle'.
-
-
-
- THE FUTURE
-
- In the not so near future I will be embelishing this library
- into a full fledged expanded memory management system. It will
- then be released as shareware with a required fee of $20 for any
- user who wishes to use it in software that will be released to the
- public whether it be PD, ShareWare, or Commercial. It will be free
- of charge for those who will only use it in software that will not
- be released to the public.
-
-
-