Metropoli BBS
VIEWER: isv86.asm MODE: TEXT (ASCII)
public _isv86

assume  cs:_TEXT

_TEXT   segment byte public 'CODE'
;**************************************************************************	
;       Function:	isv86()
;
;       Purpose:        Determine if CPU is in REAL or V86
;       Technique:      Check PE bit.  If set then assume V86.
;                       *** Note ***  This technique only works
;                                     for distinguishing V86 vs REAL.
;                                     IT does not hold for anything else!
;       Inputs:         none
;       Output:         ax == 1 in V86 mode, else 0 
;**************************************************************************

_isv86 proc near
        .486P
        smsw    ax
        test    al, 1
        jz      no_v86
        mov     ax, 1
        jmp     done

no_v86:        
        mov     ax, 0
done:
        ret

_isv86  endp
_TEXT   ends
end

   

[ RETURN TO DIRECTORY ]