home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / memory / emslib / emslib.doc < prev    next >
Encoding:
Text File  |  1988-04-23  |  7.9 KB  |  284 lines

  1.  
  2.  
  3.                     Expanded Memory Interface Library
  4.                    Copywrite (c) 1988 Shamaal Software
  5.                      Written by : Donley R. P'Simer
  6.  
  7.             The file SEMS.LIB contains MSC v5.0 compatible routines that
  8.    allows the C programmer to access Expanded memory under the LIM Expanded
  9.    Memory specification.
  10.  
  11.    LICENSE
  12.  
  13.             You are hereby authorized to freely copy and distribute this
  14.    ARCfile in an unmodified form.
  15.             You are authorized to use the functions contained in the 
  16.    library without giving any credit to me (Donley P'Simer) or to 
  17.    Shamaal Software. These routines are simple and were easy to write.
  18.    I am offering this library for your convenience only.
  19.  
  20.    DISCLAIMER
  21.  
  22.             Neither I (Donley P'Simer) nor Shamaal Software are liable 
  23.    for any damages resulting from the use of this library.
  24.             If you break this code you have both pieces.
  25.  
  26.    DONATIONS
  27.  
  28.             If you find these function useful and would like to express 
  29.    your appreciation in a monetary form, please make checks payable to:
  30.    ($5 seems appropriate)
  31.  
  32.                      Donley R. P'Simer
  33.                      1045 Kalmia ave.
  34.                      Boulder, Colorado 80302
  35.  
  36.    please include a note telling me why you are sending me money.
  37.  
  38.    SUPPORT
  39.  
  40.             Since this is PUBLIC DOMAIN software I will not promise any 
  41.    support for these functions, but if you have problems with them feel 
  42.    free to send me NETMAIL at 104/63 or leave me mail on:
  43.  
  44.                Into The Wind BBS (104/63) -- (303)-939-9272
  45.                300/1200/2400 baud N81
  46.  
  47.    if I have time I will be more than happy to help you with any 
  48.    problems you may have with these functions. Your constuctive 
  49.    criticism will be greatly appreciated.
  50.  
  51.    REFERENCE
  52.  
  53.        Global Vars:
  54.  
  55.          unsigned char EMSVer   --- Contains the Version of the EMM 
  56.                                     software in BCD format.
  57.          unsigned char emserr   --- Contains the Last error reported by 
  58.                                     the EMM.
  59.          unsigned EMSPgFrm      --- Contains the address of the EMS page 
  60.                                     frame segment.
  61.          unsigned EMSPgNum      --- Contains the total number of logical pages
  62.                                     in the system.
  63.          unsigned EMSAvail      --- Contains the Number of logical pages
  64.                                     currently available.
  65.  
  66.        EMS Functions :
  67.  
  68.  
  69.  
  70.          unsigned emsavail();
  71.  
  72.             Description :
  73.  
  74.                  Determines if there is an EMM installed in the computer
  75.             system. You must call this function before any other in this 
  76.             library. I have not added enough error checking to the other 
  77.             routines to stop them from calling the EMM interrupt if 
  78.             there is no EMM present. If your program calls the other 
  79.             functions when there is no EMM present unpredictable things 
  80.             will happen.
  81.  
  82.             Returns :
  83.  
  84.                  emsavail() returns NOEMS if there is no EMM otherwise 
  85.             proceed.
  86.  
  87.  
  88.  
  89.  
  90.          unsigned char emsinit();
  91.  
  92.             Description :
  93.  
  94.                Initializes all global variables.
  95.  
  96.             Returns :
  97.  
  98.                error code as described in emslib.h.
  99.  
  100.  
  101.  
  102.          unsigned char emstat();
  103.  
  104.             Description :
  105.  
  106.                Test's whether the expanded memory hardware is 
  107.             functional.
  108.  
  109.             Returns :
  110.  
  111.                error code as described in emslib.h
  112.  
  113.  
  114.  
  115.          unsigned emspgfrm();
  116.  
  117.             Description :
  118.  
  119.                Gets the adress of the page frame segment from the EMM.
  120.  
  121.             Returns :
  122.  
  123.                the page frame adress. If (emserr != NOERR) then this
  124.             function returns an error code as described in emslib.h. 
  125.             this error code will be the same as the contents of emserr.
  126.  
  127.  
  128.  
  129.          unsigned emspages();
  130.  
  131.             Description :
  132.  
  133.                This function sets the variables EMSAvail and EMSPgNum to 
  134.             their appropriate values.
  135.  
  136.             Returns :
  137.  
  138.                error code as described in emslib.h. 
  139.  
  140.  
  141.  
  142.          unsigned char _emsopen(pgs)
  143.          unsigned pgs;           --- Number of pages to allocate to 
  144.                                      handle.
  145.  
  146.             Description :
  147.  
  148.                Instructs the EMM to allocate (pgs) number of logical 
  149.             pages for the calling application.
  150.  
  151.             Returns :
  152.  
  153.                If (emserr != NOERR) then this function returns an error 
  154.             code as described in emslib.h, otherwise it returns a handle 
  155.             for the program to use in any further references to the 
  156.             memory it has requested.
  157.  
  158.  
  159.  
  160.          unsigned char _emsmap(physpg,logpg,hand)
  161.          unsigned physpg;    --- Physical page.
  162.          unsigned logpg;     --- Logical page.
  163.          unsigned char hand; --- EMM handle.
  164.  
  165.             Description :
  166.  
  167.                This function instructs the EMM to map the logpg belonging 
  168.             to handle into physical page physpg.
  169.  
  170.             Returns :
  171.  
  172.                error code as described in emslib.h.
  173.  
  174.  
  175.  
  176.          unsigned char _emsclose(hand)
  177.          unsigned char hand; --- EMM handle.
  178.  
  179.             Description :
  180.  
  181.                Realeases all EMS memory owned by handle.
  182.  
  183.             Returns :
  184.  
  185.                error code as described in emslib.h.
  186.  
  187.  
  188.  
  189.          unsigned char minver();
  190.  
  191.             Description :
  192.  
  193.                Gets the minor version number of the EMM software. 
  194.             emsinit() must have been called previously.
  195.  
  196.             Returns :
  197.  
  198.                The minor verion number of the EMM software.
  199.  
  200.  
  201.  
  202.          unsigned char majver();
  203.  
  204.             Description :
  205.  
  206.                Gets the major version number of the EMM software.
  207.             emsinit() must have been called previously.
  208.  
  209.             Returns :
  210.  
  211.                The major verion number of the EMM software.
  212.  
  213.  
  214.  
  215.          unsigned char emssvmap(hand)
  216.          unsigned char hand; --- EMM handle.
  217.  
  218.             Description :
  219.  
  220.                Saves the current mapping context. This routine is for 
  221.             TSR's and interrupt handlers that use expanded memory.
  222.  
  223.             Returns :
  224.  
  225.                error code as descibed in emslib.h
  226.  
  227.  
  228.  
  229.          unsigned char emsrsmap(hand)
  230.          unsigned char hand; --- EMM handle.
  231.  
  232.             Description :
  233.  
  234.                Restores mapping context previously save with the 
  235.            emssvmap() function. Again, this routine is for TSR's and 
  236.            interrupt handlers that use expanded memory.
  237.  
  238.             Returns :
  239.  
  240.                error code as described in emslib.h
  241.  
  242.  
  243.  
  244.          unsigned char emshnum();
  245.  
  246.             Description :
  247.  
  248.                Gets the total number of handles using Expanded memory.
  249.  
  250.             Returns :
  251.  
  252.                if (emserr != NOERR) this function returns an error code 
  253.             otherwise it returns the number of active handles using
  254.             expanded memory.
  255.  
  256.  
  257.  
  258.  
  259.          unsigned emspgnum(handle)
  260.          unsigned char handle; --- EMM handle.
  261.  
  262.             Description :
  263.  
  264.                Gets the number of pages owned by 'handle'.
  265.  
  266.             Returns :
  267.  
  268.                if (emserr != NOERR) this function returns an error code 
  269.             otherwise it returns the number of pages owned by 'handle'.
  270.  
  271.  
  272.  
  273.    THE FUTURE
  274.  
  275.          In the not so near future I will be embelishing this library 
  276.       into a full fledged expanded memory management system. It will 
  277.       then be released as shareware with a required fee of $20 for any 
  278.       user who wishes to use it in software that will be released to the 
  279.       public whether it be PD, ShareWare, or Commercial. It will be free
  280.       of charge for those who will only use it in software that will not 
  281.       be released to the public.
  282.  
  283.  
  284.