home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / SUPER_C.ZIP / SHOWEQ.C < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-01  |  1.7 KB  |  47 lines

  1. #include "eqlib.h"
  2.  
  3. /*      main()
  4.  
  5.         Function: Get and display the system memory size and the
  6.         equipment configuration.
  7.  
  8.         Algorithm: Call the ROM BIOS interface routines memSz and
  9.         getEq. Then interpret their replies and display the results.
  10. */
  11.  
  12. main()
  13.  
  14. {
  15.         int theEq;      /* The equipment configuration. */
  16.         int i;
  17.  
  18.         /* Display the memory size. */
  19.         printf("Memory size is %dK.\n\n Equipment present:\n   ",memSz());
  20.  
  21.         /* Get the equipment configuration. */
  22.         theEq = getEq();
  23.         /* Get the number of printers. */
  24.         i = (theEq & prtnMask) >> prtnShft;
  25.         /* If there are any at all, show how many. */
  26.         if (i != 0) printf("%d printer(s).\n   ",i);
  27.         /* If there's a game I/O interface present, say so. */
  28.         if (theEq & gioMask) printf("1 game I/O.\n   ");
  29.         /* Get the number of serial ports. */
  30.         i = (theEq & RS232Mask) >> RS232Shft;
  31.         /* If there are any, show how many. */
  32.         if (i != 0) printf("%d serial port(s).\n   ",i);
  33.         /* If there are any diskette drives present, show how many. */
  34.         if (theEq & diskMask) printf("%d diskette drive(s).\n   ",
  35.                                      ((theEq & dsknMask) >> dsknShft)+1);
  36.         /* Show the initial video mode. */
  37.         printf("Initial video mode: ");
  38.         i = theEq & vmodeMask;
  39.         if (i == CO40) printf("40x25 color");
  40.         else if (i == CO80) printf("80x25 color");
  41.         else if (i == MONO) printf("80x25 monochrome");
  42.         /* Show the system board RAM size. */
  43.         printf(".\n   System board RAM size: %dK bytes.\n",
  44.                16*(((theEq & sbramMask) >> sbramShft)+1));
  45. }
  46.  
  47.