Microsoft KB Archive/42113

MSJ EMS: Writing Programs for Expanded Memory

PSS ID Number: Q42113 Article last modified on 04-16-1991

MS-DOS

Summary: The following is a summary of the program found in the “Microsoft Systems Journal” and in the Software/Data Library: Issue: March 1987, Vol. 2, No. 1, pages 21-32 Title: “Expanded Memory: Writing Programs That Break the 640K Barrier” Authors: Marion Hansen, Bill Krueger, Nick Stuecklen Keyword: EMS EMS can be found in the Software/Data Library by searching on the keyword EMS, the Q number of this article, or S10003. EMS was archived using the PKware file-compression utility. The following text is taken from the cover of the “Microsoft Systems Journal”: Once, 640K of memory seemed like more than enough, but as programs written for DOS grew larger, the 640K limit was just too small. The LIM Expanded Memory Specification (EMS) defines a standard that allows developers to access expanded memory beyond 640K.

More Information: The contents of the archived file, EMS (13320 bytes), are:

Contents

 * 1) File: EMSTOOLS.ASM

Size: 24215 bytes Function: Assembler routines for EMS manipulation and use Routine Function ——- ——– GetEMSMem Reserves EMS memory for caller SaveEMSMem Saves the context of the EMS driver RestoreEMSMem Restores the context of the EMS driver saved by SaveEMSMem FreeEMSMem Deallocates EMS memory CheckAlias Checks for memory aliasing support by EMS driver MapbyName Maps a logical EMS page to a physical page by name FindEMS Determines if EMS manager is loaded check_ems_hdl Tests for driver by open handle technique check_ems_int Tests for driver by interrupt technique EMS32Upgrade Emulates 4.0 LIM functions in 3.2 EMSMapMultiple Simulates 4.0 Map Multiple function in 3.2 EMSMapandJump Simulates 4.0 Map and Jump function in 3.2 EMSMapandCall Simulates 4.0 Map and Call function in 3.2 See file for syntax and use.
 * 1) File: EXAMPLE.ASM

Size: 6629 bytes Function: Source code for EXAMPLE.EXE.
 * 1) File: EXAMPLE.EXE

Size: 2096 bytes Function: Sample program that uses some of the above modules to copy a screen to EMS and then switch from the saved screen to the current screen each time “c” is pressed.