home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / msj / msjv3_1 / lim4 / save.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-02  |  1.5 KB  |  45 lines

  1. /*
  2.  
  3. Figure 3
  4. ========
  5.  
  6. */
  7.  
  8. /******************************************************************/
  9. /* This function checks to see if an expanded memory manager is   */
  10. /* and then checks to see if the version number is >= 4.0. It     */
  11. /* uses emm function GET VERSION NUMBER.                          */
  12. /******************************************************************/
  13.  
  14. int check_emm_version_number()
  15. {  
  16.    char *emm_device_name_ptr ;
  17.    
  18.    /***************************************************************/
  19.    /* Use the dos get interrupt function (0x35) to get pointer    */
  20.    /* at interrupt vector 0x67, and check for emm device name.    */
  21.    /***************************************************************/
  22.  
  23.    inregs.h.ah = 0x35;
  24.    inregs.h.al =EMM_INT;
  25.    intdosx(&inregs, &outregs, &segregs);
  26.    emm_device_name_ptr = (segregs.es * 65536) + 10;
  27.    if (memcmp(emm_device_name, emm_device_name_ptr,8) !=0)
  28.      {
  29.        printf("Expanded memory manager not present\n");
  30.        exit(1);
  31.      }
  32.  
  33.    /***************************************************************/
  34.    /* Now check for version number >= 4.0                         */    
  35.    /***************************************************************/
  36.  
  37.    inregs.h.ah = GET_VERSION ;  /* set funciton code */
  38.    int86(EMM_INT,&inregs,&outregs);
  39.    if (outregs.h.ah != 0) exit(1);
  40.    if ((outregs.h.ah == 0) & (outregs.h.al < 0x40))
  41.    {
  42.      printf("Expanded memory manager does not support LIM 4.0");
  43.      exit(1) ;
  44.    }  
  45. }