Micro Digital Inc.  
   
Home
 

 

What's New

 

 

Executive Summary

 

 

Products

 

 

Prices

 

 

Company

 

 

Customers

 

 

Partners

 

 

Distributors

 

 

Training

 

 

Consulting

 

 

Support

 

 

Articles

 

 

Downloads

 

 

Contact Us

 
 
smxEMS
 
     
 
The Easy Way to Access Extended Memory!
 
     
  Extended memory, by definition, is memory above 1 megabyte. Normally this memory is inaccessible from real mode. smx Extended Memory Services (smxEMS) provides a solution to this problem. For 386 processors and up, smxEMS provides two modes of access to extended memory:  
     
 

Mode

0 Copy data to a real memory buffer from an extended memory buffer or vice versa.
1 Access extended memory via a window.
 
     
 

Both spare the user the complexities of protected mode.

Mode 0 allows operation in real mode. smxEMS calls switch into protected mode to perform their functions, then return to real mode. While in protected mode, interrupts are disabled. Typical transfer time for 512 bytes on a 20 MHz 386DX is 375 microseconds.

Mode 1 puts the application and smx into Virtual 8086 mode. In this mode, interrupts are disabled only when changing the window, not when accessing extended memory. Interrupts (which must occur in protected mode) are automatically mapped to the correct real mode interrupt service routines. This adds some overhead to interrupt servicing. The user may choose, instead, to write protected mode isr's.

smxEMS is provided in source code form with on-disk documentation.

 
     
 

smxEMS provides the following services:

Ems_Initialize (mode, size)
Determines amount of extended memory and divides it into blocks. Then establishes VM86 environment, if mode 1 is specified.
Ems_Test ()
Tests if in protected mode

Mode 0:

Ems_Allocate (num_bytes)
Allocates a buffer of size num_bytes. Returns handle to it.
Ems_Free (handle)
Frees buffer.
Ems_CopyTo (handle, real_buf)
Copies from real_buf to extended memory buffer.
Ems_CopyFrom (handle, real_buf)
Inverse.

Mode 1:

Ems_Exit ()
Returns processor to real mode.
Ems_MapPage (seg)
Sets real address of window to seg.
Ems_SetPage (block)
Maps extended memory block to window.