home *** CD-ROM | disk | FTP | other *** search
/ 98 Driver Collection MD-0164 / DRIVER_KING_98.iso / CPU / cyrix / IS486.ASM < prev    next >
Encoding:
Assembly Source File  |  1996-12-26  |  1.1 KB  |  51 lines

  1. public _is486
  2.  
  3. assume  cs:_TEXT
  4.  
  5. _TEXT   segment byte public 'CODE'
  6.  
  7. ;**************************************************************************    
  8. ;       Function:    is486 ()
  9. ;
  10. ;       Purpose:        Check for presence of a 486 level support.
  11. ;
  12. ;       Returns:        1 if 486 or better present.
  13. ;                       0 if earlier than a 486 is present.
  14. ;                       
  15. ;**************************************************************************
  16.  
  17. _is486  proc near
  18.  
  19.         .486
  20.     pushfd            ; save EFLAGS
  21.  
  22.     pop    eax        ; get EFLAGS
  23.     mov    ecx, eax    ; temp storage EFLAGS
  24.     xor    eax, 40000h    ; change AC bit in EFLAGS
  25.  
  26.     push    eax        ; put new EFLAGS value on stack
  27.     popfd            ; replace current EFLAGS value
  28.  
  29.     pushfd            ; get EFLAGS
  30.     pop    eax        ; save new EFLAGS in EAX
  31.     cmp    eax, ecx    ; compare temp and new EFLAGS
  32.  
  33.         jz      is_not_80486
  34.     mov    ax, 1            ; 80486 present 
  35.         jmp     done
  36.  
  37. is_not_80486:        
  38.         mov     ax, 0           ; 80486 not present
  39.  
  40. done:
  41.     push    ecx             ; get original EFLAGS
  42.     popfd            ; restore EFLAGS 
  43.         ret
  44.  
  45.  
  46. _is486  endp
  47. _TEXT   ends
  48.  
  49. end
  50.  
  51.