home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / hsc14ecr.zip / ADLIBTST.INC next >
Text File  |  1994-01-02  |  1KB  |  26 lines

  1. ;───────────────────────────────────────────────────────────────────────────────
  2. ;          Adlib Detection routine, returns CF set on error
  3. ;───────────────────────────────────────────────────────────────────────────────
  4. ; A joint venture by Phil Carlisle pc@espr.demon.co.uk and Lee Hamill...
  5. ; i.e. I posted some code, and he posted the correct code :))
  6. ; idea by someone else entirely....
  7. ; its tested and seems to work...
  8.  
  9. PROC Detectadlib                              ;proc to detect adlib
  10.                 stc                           ;set the carry flag (default)
  11.                 pusha                         ;preserve regs
  12.                 mov     dx,0388h              ;use the code posted by lee
  13.                 in      al,dx                 ;someone else suggested it...
  14.                 cmp     al,0                  ;seems to work
  15.                 je      @@there               ;adlib present, clear carry flag
  16.                 cmp     al,6                  ;adlib not present if al<>0 OR 6
  17.                 jne     @@carryon             ;and again...
  18.                                               ;
  19. @@there:        clc                           ;clear cf, adlib is there
  20. @@carryon:
  21.                 popa                          ;restore our regs
  22.                 ret                           ;return
  23. ENDP                                          ;end of detect adlib proc
  24.  
  25.  
  26.