home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / PCISCPQ.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-02-03  |  1.5 KB  |  74 lines

  1. ; pciscpq.asm
  2. ;
  3. ; 12/13/88 by Ted
  4. ;
  5. ; Low level function for Oakland pc mode detection.
  6. ;
  7. ; OWL-PCA 1.2
  8. ; Copyright (c) 1988, 1989 Oakland Group Inc.
  9. ; ALL RIGHTS RESERVED
  10. ;
  11. ;------------------------REVISION HISTORY--------------------------------------;
  12. ;
  13. ;     6/29/89 ted    Converted vga_getinfo to C, renamed from pcinfo.asm
  14. ;
  15. ;------------------------------------------------------------------------------;
  16. include    PCDECL.MAC
  17.  
  18. DSEG
  19. compaq_str        db 'COMPAQ'
  20. ENDDS
  21. compaqlen equ    6
  22. ;------------------------------------------------------------------------------;
  23.     PSEG
  24. ;------------------------------------------------------------------------------;
  25. ROMSEG  = 0F000h
  26. ROMOFFS = 0A000h
  27. ROMLEN    = (06000h - 1 - compaqlen)
  28.  
  29. pubproc    pc_IsCompaq
  30.     pushm <ds, es, si, di>
  31.  
  32.     mov cx, ROMLEN
  33.     mov di, ROMOFFS
  34.     mov ax, ROMSEG
  35.     mov es, ax
  36.  
  37. IF FAR_DATA
  38.     mov ax, seg DGROUP:compaq_str
  39.     mov ds, ax
  40. ENDIF
  41.     mov al, ds:compaq_str[0]
  42.     cld
  43. tryagain:
  44. ; find an occurrence of the first char in the string
  45.     repne scasb
  46.     jne notfound
  47.  
  48. ; search for the rest of the string
  49.     push cx
  50.     push di
  51.  
  52.     mov cx, compaqlen-1
  53.     mov si, offset DGROUP:compaq_str + 1
  54.     repe cmpsb
  55.  
  56.     pop di
  57.     pop cx
  58.  
  59.     jne tryagain
  60.  
  61.     mov ax, 1
  62.     jmp short icret
  63. notfound:
  64.     mov ax, 0
  65. icret:
  66.     popm <di, si, es, ds>
  67.     ret
  68. endproc    pc_IsCompaq
  69. ;------------------------------------------------------------------------------;
  70.     ENDPS
  71.     end
  72. ;------------------------------------------------------------------------------;
  73.  
  74.