home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / TASMSWAN.ZIP / EQUIP.ASM < prev    next >
Assembly Source File  |  1989-07-14  |  2KB  |  106 lines

  1. %TITLE  "Displays PC equipment information"
  2.  
  3.     IDEAL
  4.     DOSSEG
  5.     MODEL    small
  6.     STACK    256
  7.  
  8. EOS    EQU    0
  9. cr    EQU    13
  10. lf    EQU    10
  11.  
  12. RECORD Equip printers:2,x:1,game:1,ports:3,y:1,drives:2,mode:2,ram:2,z:1,disk:1
  13.  
  14. ;---------------------------------
  15. ;AND Mask     |    FIELD
  16. ;---------------------------------
  17. maskPrinters    = MASK    printers
  18. maskGame    = MASK  game
  19. maskPorts    = MASK  ports
  20. maskDrives    = MASK  drives
  21. maskMode    = MASK  mode
  22. maskDisk    = MASK  disk
  23.  
  24.     DATASEG
  25.  
  26. exitCode    db    0
  27. welcome        db    cr,lf,'Equipment determination'
  28.         db    cr,lf,'(C) 1989 by Tom Swan',cr,lf,cr,lf,EOS
  29. strPrinters    db    'Number of printers ........ ', EOS
  30. strGame        db    'Game I/O ports ............ ', EOS
  31. strPorts    db    'Number of RS232 ports ..... ', EOS
  32. strDrives    db    'Disk drives (minus 1) ..... ', EOS
  33. strMode        db    'Initial video mode ........ ', EOS
  34. strDisk        db    'Has disk drive (1 = yes) .. ', EOS
  35. string        db    40 DUP (?)
  36.  
  37.  
  38.     CODESEG
  39.  
  40. ;------ From STRIO.OBJ & BINASC.OBJ
  41.  
  42.     EXTRN    BinToAscDec:proc, StrWrite:proc, NewLine:proc
  43.  
  44. Start:
  45.     mov    ax,@data
  46.     mov    ds,ax
  47.     mov    es,ax
  48.  
  49.     mov    di, OFFSET welcome
  50.     call    StrWrite
  51.     int    11h
  52.     mov    bx,ax
  53.     mov    di, OFFSET strPrinters
  54.     mov    dx,maskPrinters
  55.     mov    cl,printers
  56.     call    ShowInfo
  57.     mov    di, OFFSET strGame
  58.     mov    dx,maskGame
  59.     mov    cl,game
  60.     call    ShowInfo
  61.     mov    di, OFFSET strPorts
  62.     mov    dx,maskPorts
  63.     mov    cl,ports
  64.     call    ShowInfo
  65.     mov    di, OFFSET strDrives
  66.     mov    dx,maskDrives
  67.     mov    cl,drives
  68.     call    ShowInfo
  69.     mov    di, OFFSET strMode
  70.     mov    dx, maskMode
  71.     mov    cl,mode
  72.     call    ShowInfo
  73.     mov    di, OFFSET strDisk
  74.     mov    dx,maskDisk
  75.     mov    cl,disk
  76.     call    ShowInfo
  77. Exit:
  78.     mov    ah,04Ch
  79.     mov    al,[exitCode]
  80.     int    21h
  81. %NEWPAGE
  82. ;---------------------------------------------------------------------
  83. ;  ShowInfo - displays label & equipment value
  84. ;---------------------------------------------------------------------
  85. ;     Input:    bx = Equipment data from int 11h
  86. ;        cl = Bit field shift count
  87. ;        dx = Bit field AND mask
  88. ;        di = Address of label string
  89. ;    Output:    label & data value displayed
  90. ;    Registers:  ax,cx
  91. ;---------------------------------------------------------------------
  92. PROC    ShowInfo
  93.     mov    ax,bx
  94.     and    ax,dx
  95.     shr    ax,cl
  96.     call    StrWrite
  97.     mov    di, OFFSET string
  98.     mov    cx,1
  99.     call    BinToAscDec
  100.     call    StrWrite
  101.     call    NewLine
  102.     ret
  103. ENDP    ShowInfo
  104.  
  105.     END    Start
  106.