home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctech / 1986_08 / atbios.pas < prev    next >
Pascal/Delphi Source File  |  1986-10-13  |  5KB  |  138 lines

  1. { ATBIOS -- PC Tech Journal AT BIOS Information Display Program  }
  2. {                                                                }
  3. { Version 1.01                                                   }
  4. { Last modified 10/14/86                                         }
  5. { Changes:                                                       }
  6. {       1. Strip non-alphanumeric characters from the            }
  7. {          copyright display.                                    }
  8. {       2. Don't check game adapter bit in equipment flags       }
  9. {          for AT machine type.  It is not used by AT.           }
  10. {       3. Turn on Turbo Pascal I/O redirection.                 }
  11. {                                                                }
  12. { Copyright (c) 1986, PC Tech Journal                            }
  13. { Program by: Paul Pierce, Ted Forgeron, Steven Armbrust         }
  14. {                                                                }
  15. { Displays pertinent information from the BIOS code and data     }
  16. { areas.                                                         }
  17. {                                                                }
  18. { This program is written in Turbo Pascal.  However, it can      }
  19. { be easily ported to any Pascal compiler that allows absolute   }
  20. { addressing.                                                    }
  21.  
  22. {$P512}
  23.  
  24. PROGRAM at_bios_info ;
  25.  
  26.   CONST
  27.     at_id = $fc ;
  28.     printer_mask = $c000 ;
  29.     game_mask = $1000 ;
  30.     serial_mask = $0e00 ;
  31.     dma_mask = $0100 ;
  32.     drive_num_mask = $00c0 ;
  33.     video_mask = $0030 ;
  34.     ndp_mask = $0002 ;
  35.     drive_mask = $0001 ;
  36.     co40 = $0010 ;
  37.     co80 = $0020 ;
  38.     mono = $0030 ;
  39.  
  40.   VAR
  41.     i : integer ;
  42.     romdate : ARRAY [1..9] OF char absolute $f000:$fff5 ;
  43.     machine_id : byte absolute $f000:$fffe ;
  44.     copyright : ARRAY [1..80] OF char absolute $f000:$e000 ;
  45.     equip_flag : integer absolute $40:$10 ;
  46.     mem_size : integer absolute $40:$13 ;
  47.     key_buf : ARRAY [1..32] OF char absolute $40:$1e ;
  48.     video_mode : byte absolute $40:$49 ;
  49.  
  50.   BEGIN
  51.     clrscr ;
  52.     write('ATBIOS -- PC Tech Journal AT BIOS Information ') ;
  53.     writeln('Display') ;
  54.     writeln('Version 1.01, Copyright (c) 1986 PC Tech Journal') ;
  55.     writeln ;
  56.     writeln('ROM BIOS date is                       ',romdate) ;
  57.     IF machine_id = at_id THEN
  58.       writeln('Machine ID is                          AT COMPATIBLE')
  59.     ELSE
  60.       writeln('Machine ID is                          NOT AT') ;
  61.     write('Copyright Statement is                 ') ;
  62.     FOR i := 1 TO 80 DO
  63.       BEGIN
  64.         IF (copyright[i] < ' ') OR (copyright[i] > '~') THEN
  65.           write('.')
  66.         ELSE
  67.           write(copyright[i]) ;
  68.         IF i = 40 THEN
  69.           BEGIN
  70.             writeln ;
  71.             write('                                       ') ;
  72.           END ;
  73.       END ;
  74.     writeln ;
  75.     write('Diskette Drives Installed              ') ;
  76.     IF (equip_flag AND drive_mask) <> 0 THEN
  77.       writeln(((drive_num_mask AND equip_flag) DIV 64)+1)
  78.     ELSE
  79.       writeln('0') ;
  80.     write('80287 Math Coprocessor                 ') ;
  81.     IF (equip_flag AND ndp_mask) <> 0 THEN
  82.       writeln('YES')
  83.     ELSE
  84.       writeln('NO') ;
  85.     write('Initial Video Mode                     ') ;
  86.     CASE (equip_flag AND video_mask) OF
  87.       co40 : writeln('CGA 40x25 B/W text') ;
  88.       co80 : writeln('CGA 80x25 B/W text') ;
  89.       mono : writeln('Monochrome 80x25 text') ;
  90.     END ;
  91.     write('Current Video Mode                     ') ;
  92.     CASE video_mode OF
  93.       00 : writeln('CGA 40x25 B/W text') ;
  94.       01 : writeln('CGA 40x25 16-color text') ;
  95.       02 : writeln('CGA 80x25 B/W text') ;
  96.       03 : writeln('CGA 80x25 16-color text') ;
  97.       04 : writeln('CGA 320x200 4-color graphics') ;
  98.       05 : writeln('CGA 320x200 4-gray graphics') ;
  99.       06 : writeln('CGA 640x200 B/W graphics') ;
  100.       07 : writeln('Monochrome 80x25 text') ;
  101.       08 : writeln('JR 160x200 16-color graphics') ;
  102.       09 : writeln('JR 320x200 16-color graphics') ;
  103.       10 : writeln('EGA 640x200 4/64-color graphics') ;
  104.       13 : writeln('EGA 320x200 16-color graphics') ;
  105.       14 : writeln('EGA 640x200 16-color graphics') ;
  106.       15 : writeln('EGA 640x350 4-color graphics') ;
  107.     END ;
  108.     write('DMA Present                            ') ;
  109.     IF (equip_flag AND dma_mask) <> 0 THEN
  110.       writeln('NO')
  111.     ELSE
  112.       writeln('YES') ;
  113.     writeln('RS-232 Serial Ports                    ',
  114.             (equip_flag AND serial_mask) DIV 512) ;
  115.     IF machine_id <> at_id THEN
  116.       BEGIN
  117.         write('Game Adapter Present                   ') ;
  118.         IF (equip_flag AND game_mask) <> 0 THEN
  119.           writeln('YES')
  120.         ELSE
  121.           writeln('NO') ;
  122.       END ;
  123.     writeln('Parallel Printer Ports                 ',
  124.             abs((equip_flag AND printer_mask) DIV 16384)) ;
  125.     writeln('Memory Size in K Bytes                 ',mem_size) ;
  126.     write('Keyboard Buffer Contents               ') ;
  127.     i := 1 ;
  128.     WHILE i <= 32 DO
  129.       BEGIN
  130.         IF (key_buf[i] < ' ') OR (key_buf > '~') THEN
  131.           write('.')
  132.         ELSE
  133.           write(key_buf[i]) ;
  134.         i := i + 2 ;
  135.       END ;
  136.     writeln ;
  137.   END.
  138.