home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / asmlib.zip / SYSHARD.ASM < prev    next >
Assembly Source File  |  1992-06-14  |  3KB  |  201 lines

  1. include    asm.inc
  2.  
  3. public    syshard
  4. extrn    isems:proc, ismouse:proc, isherc:proc
  5. extrn    floppies:proc, floppytype:proc
  6. extrn    getkey:proc, getcrt:proc
  7. extrn    getcpu:proc, mathchip:proc
  8. extrn    wclear:proc, wframe:proc, tprint:proc
  9.  
  10. .data
  11. notinstalled    db 'Not installed',0
  12. f360        db '360 kb drive',0
  13. f12        db '1.2 Mb drive',0
  14. f720        db '720 kb drive',0
  15. f14        db '1.4 Mb drive',0
  16.  
  17. drive_table    dw notinstalled
  18.         dw f360
  19.         dw f12
  20.         dw f720
  21.         dw f14
  22.  
  23. i8086        db '8086 or 8088',0
  24. i186        db '80186 or 80188',0
  25. i286        db 'i286',0
  26. i386        db '386',0
  27. i486        db '486',0
  28.  
  29. cpu_table    dw i8086
  30.         dw i186
  31.         dw i286
  32.         dw i386
  33.         dw i486
  34.  
  35. no87        db 'none',0
  36. mc8087        db '8087',0
  37. mc287        db '287',0
  38. mc387        db '387',0
  39. mc487        db '487',0
  40.  
  41. mathchip_table    dw no87
  42.         dw mc8087
  43.         dw mc287
  44.         dw mc387
  45.         dw mc487
  46.  
  47. ; window corner data
  48. r0    dw 3
  49. c0    dw 15
  50. r1    dw 3+number_of_labels+1
  51. c1    dw 54
  52. window_color    db 0Ch        ; bright red, black background
  53. text_color    db 07h
  54.  
  55. cga    db 'CGA',0
  56. mda    db 'Monochrome text',0
  57. ega    db 'EGA',0
  58. mcga    db 'MCGA',0
  59. vga    db 'VGA',0
  60. Herc    db 'Hercules',0
  61. RamFont    db 'Hercules RAMFont',0
  62. InColor    db 'Hercules InColor',0
  63.  
  64. screen_table    dw cga
  65.         dw mda
  66.         dw ega
  67.         dw mcga
  68.         dw vga
  69.         dw herc
  70.         dw ramfont
  71.         dw incolor
  72.  
  73. ; labels
  74. labels    db 'CPU:          ',0
  75. size_of_label    equ $-labels
  76.     db '80x87:        ',0
  77. ;    db 'RAM:          ',0
  78.     db 'EMS:          ',0
  79.     db 'Drive A:      ',0
  80.     db 'Drive B:      ',0
  81.     db 'Mouse:        ',0
  82.     db 'Screen:       ',0
  83. number_of_labels    equ ($-labels)/size_of_label
  84.  
  85. isinstalled    db 'installed and active',0
  86.  
  87. mouse_installed    db '  buttons',0
  88.  
  89. .code
  90. syshard    proc
  91. ; clear a window for the system info
  92.     lea    bx,r0
  93.     mov    ah,window_color
  94.     call    wclear
  95.     mov    al,-1        ; double-lined window frame
  96.     call    wframe
  97.  
  98. ; print labels at left side of window
  99.     mov    cx,number_of_labels
  100.     mov    dh,byte ptr r0
  101.     mov    dl,byte ptr c0
  102.     inc    dl
  103.     lea    si,labels
  104.     mov    ah,text_color
  105. label_loop:
  106.     inc    dh
  107.     call    tprint
  108.     add    si,size_of_label
  109.     loop    label_loop
  110.  
  111. ; determine CPU type
  112.     call    getcpu
  113.     mov    bx,ax
  114.     shl    bx,1
  115.     mov    si,cpu_table[bx]
  116.     mov    dh,byte ptr r0
  117.     inc    dh
  118.     mov    dl,byte ptr c0
  119.     add    dl,size_of_label
  120.     mov    ah,text_color
  121.     call    tprint
  122.  
  123. ; math coprocessor
  124.     call    mathchip
  125.     mov    bx,ax
  126.     shl    bx,1
  127.     mov    si,mathchip_table[bx]
  128.     inc    dh
  129.     mov    ah,text_color
  130.     call    tprint
  131.  
  132. ; installed RAM
  133. ; I haven't done this yet
  134. ;    inc    dh
  135.  
  136. ; EMS memory
  137.     inc    dh
  138.     call    isems
  139.     lea    si,notinstalled
  140.     jc    print_ems
  141.     lea    si,isinstalled
  142. print_ems:
  143.     mov    ah,text_color
  144.     call    tprint
  145.  
  146. ; floppy drive types
  147.     mov    cl,0        ; start with drive A:
  148. next_floppy:
  149.     push    dx        ; save screen coordinates
  150.     mov    dl,cl        ; drive number
  151.     call    floppytype
  152.     pop    dx        ; screen coordinates
  153.     or    ax,ax        ; AX = 0 if bad drive number
  154.     jz    no_more_floppies
  155.     inc    dh        ; next row on screen
  156.     mov    bx,ax        ; drive ID
  157.     shl    bx,1        ; convert to offset
  158.     mov    si,drive_table[bx]
  159.     mov    ah,text_color
  160.     call    tprint
  161.     inc    cl        ; next drive
  162.     jmp    next_floppy
  163. no_more_floppies:
  164.  
  165. ; Mouse
  166.     inc    dh
  167.     call    ismouse
  168.     lea    si,notinstalled
  169.     or    ax,ax
  170.     jz    print_mouse
  171.     lea    si,mouse_installed
  172.     add    al,'0'        ; convert to ASCII
  173.     mov    [si],al
  174. print_mouse:
  175.     mov    ah,text_color
  176.     call    tprint
  177.  
  178. ; Screen
  179.     inc    dh
  180.     call    getcrt
  181.     inc    ax
  182.     mov    bx,ax
  183.     cmp    ax,129
  184.     jb    print_screen
  185.     mov    bx,5
  186.     je    print_screen
  187.     cmp    ax,209        ; InColor?
  188.     inc    bx
  189.     jb    print_screen
  190.     inc    bx
  191. print_screen:
  192.     shl    bx,1
  193.     mov    si,screen_table[bx]
  194.     mov    ah,text_color
  195.     call    tprint
  196.  
  197.     call    getkey
  198.     ret
  199. syshard    endp
  200.     end
  201.