home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a081 / 2.ddi / CTFXX.EXE / EQUIP.PRG < prev    next >
Encoding:
Text File  |  1993-05-14  |  2.2 KB  |  91 lines

  1. * EQUIP.PRG -- Read the BIOS equipment byte in low memory by calling
  2. * BIOS equipment service Interrupt 11h
  3. * NOTE: Instead of calling int86(), we could have said
  4. * ? peek(0, x2d("410"))
  5. * which obtains the same information by reading the BIOS data area.
  6.  
  7. CLEAR
  8. SET TALK OFF
  9. SET ESCAPE OFF
  10.  
  11. * Load the right library
  12. foxid = VERS()
  13. IF "2.0" $ foxid
  14.     SET LIBR TO ctf                 && Identified FoxPro 2.0
  15. ELSE
  16.     IF "2.5" $ VERS()
  17.         IF "Windows" $ foxid        && Identified FoxPro 2.5 for Windows
  18.             SET LIBR TO ctfw
  19.         ELSE
  20.             SET LIBR TO ctf25       && Identified FoxPro 2.5 for DOS
  21.         ENDIF
  22.     ENDIF
  23. ENDIF
  24.  
  25.  
  26. PUBLIC ax, bx, cx, dx, si, di, cflag
  27.  
  28. ret =int86(x2d("11"), @ax, @bx, @cx, @dx, @si, @di, @cflag)
  29.  
  30. @00, 00 SAY "Value of equipment list " + d2x(ret) + "h"
  31. ** Bit 0 **
  32. IF and(ax, 1) == 1
  33.     @01, 00 SAY "Diskette drives present"
  34. ELSE
  35.     @01, 00 SAY "No diskette drives present"
  36. ENDIF
  37. ** Bit 1 **
  38. IF and(ax, 2) == 2
  39.     @02, 00 SAY "Math coprocessor installed"
  40. ELSE
  41.     @02, 00 SAY "No Math coprocessor installed"
  42. ENDIF
  43.  
  44. ** Bits 2&3: System Board RAM **
  45. ret = and(shr(ax, 2), 3)
  46. @03, 00 SAY "System board RAM bits= " + STR(ret)
  47.  
  48. ** Bits 4&5: System Video **
  49. ret = and(shr(ax, 4), 3)
  50. IF ret == 2
  51.     @04, 00 SAY "80-column color installed"
  52. ELSE
  53.     IF ret == 3
  54.         @04, 00 SAY "Monochrome video installed"
  55.     ENDIF
  56. ENDIF
  57.  
  58. ** Bits 6&7: Number of Diskette Drives **
  59. ret = and(shr(ax, 6), 3)
  60. IF ret == 0
  61.     @05, 00 SAY "One diskette drive installed"
  62. ELSE
  63.     @05, 00 SAY "Number of Diskette Drives= " + STR(ret)
  64. ENDIF
  65.  
  66. ** Bit 8: DMA chip installed"
  67. ret = and(ax, x2d("80"))
  68. IF ret != 0
  69.     @06, 00 SAY "DMA not installed"
  70. ELSE
  71.     @06, 00 SAY "DMA chip installed"
  72. ENDIF
  73.  
  74. ** Bits 9, 10 & 11: Number of Serial Ports Installed
  75. ret = shr(ax, 9)
  76. IF and(ret, 1) == 1
  77.     @07, 00 SAY "Serial port 1 installed"
  78. ENDIF
  79. IF and(ret, 2) == 2
  80.     @08, 00 SAY "Serial port 2 installed"
  81. ENDIF
  82. IF and(ret, 4) == 4
  83.     @09, 00 SAY "Serial port 3 installed"
  84. ENDIF
  85.  
  86. ** Bits 14, 15: Number of Printers Installed
  87. ret = shr(ax, 14)
  88. @10, 00 SAY "Number of Parallel Printers Installed=" + STR(ret)
  89. =INKEY(0)
  90.  
  91.