home *** CD-ROM | disk | FTP | other *** search
/ 98 Driver Collection MD-0164 / DRIVER_KING_98.iso / CPU / cyrix / ID.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-04-02  |  1.2 KB  |  38 lines

  1. assume  cs:_TEXT
  2.  
  3. public    _iscyrix
  4.  
  5. _TEXT    segment byte public 'CODE'
  6.  
  7. ;**************************************************************************    
  8. ;       Function:    int iscyrix ()
  9. ;
  10. ;       Purpose:        Determine if Cyrix CPU is present
  11. ;       Technique:      Cyrix CPUs do not change flags where flags change
  12. ;                        in an undefined manner on other CPUs
  13. ;       Inputs:         none
  14. ;       Output:         ax == 1 Cyrix present, 0 if not
  15. ;**************************************************************************
  16. _iscyrix   proc    near
  17.            .486
  18.            xor   ax, ax         ; clear ax
  19.            sahf                 ; clear flags, bit 1 is always 1 in flags
  20.            mov   ax, 5          
  21.            mov   bx, 2
  22.            div   bl             ; do an operation that does not change flags
  23.            lahf                 ; get flags
  24.            cmp   ah, 2          ; check for change in flags
  25.            jne   not_cyrix      ; flags changed not Cyrix        
  26.            mov   ax, 1          ; TRUE Cyrix CPU 
  27.            jmp   done
  28.  
  29. not_cyrix:
  30.            mov  ax, 0           ; FALSE NON-Cyrix CPU
  31. done:
  32.            ret
  33. _iscyrix   endp
  34.  
  35. _TEXT    ends
  36.     end
  37.  
  38.