home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / SNIP9404.ZIP / NDPCHECK.ASM < prev    next >
Assembly Source File  |  1994-04-03  |  1KB  |  45 lines

  1.         page    55, 132
  2.  
  3. ;
  4. ;  FUNCTION:  ndp_check
  5. ;
  6. ;  Require MASM 5.1 or later, or equivalent
  7. ;
  8. ;  Assemble with:       MASM /Mx /z ...
  9. ;                       TASM /jMASM /mx /z ...
  10. ;
  11.  
  12. %       .MODEL  memodel,C               ;Add model support via
  13.                                         ;command line macros, e.g.
  14.                                         ;MASM /Mx /Dmemodel=LARGE
  15.  
  16.         .CODE
  17.  
  18. control dw      0
  19.  
  20. ;---------------------------------------------------------------
  21. ;
  22. ; Check for an NDP.
  23. ;
  24. ;  Returns 0 if no coprocessor
  25. ;  Returns 1 if coprocessor present
  26.  
  27.         PUBLIC  ndp_check
  28.  
  29. ndp_check       PROC    USES BX
  30.         xor     BX,BX                    ; set up zero return
  31.         fninit                           ; try to initialize the NDP
  32.         mov     byte ptr control+1,0     ; clear memory byte
  33.         fnstcw  control                  ; put control word in memory
  34.         mov     AH,byte ptr control+1    ; if AH is 03h, you got
  35.         cmp     AH,03h                   ;   an NDP on board !!
  36.         jne     SHORT NDPbye
  37.         inc     BX
  38. NDPbye:
  39.         mov     AX,BX
  40.         ret
  41.  
  42. ndp_check       ENDP
  43.  
  44.         end
  45.