Anyone that can test this on any post Win 98 OS would be appreciated.
This works as intended on Win 98.

It should work on any Dos window, but what I am MOST interested is
in what it does when booted to DOS.

I know that as the Win OS's progressed(or regressed), what could be done
in the command line environment decreased.

; oss.asm Check if OS is Win 95+ and identify if booted to DOS
;INT 2F - MS Windows 3.1 - IDENTIFY WINDOWS VERSION AND TYPE
; AX = 160Ah
;Return: AX = 0000h if call supported
; BX = version (BH=major, BL=minor)
;Release Version File dates
; ------------------------------------------------------------------------
;Windows 95 retail, OEM 4.00.950 7/11/95
;Windows 95 retail SP1 4.00.950A 7/11/95-12/31/95
;OEM Service Release 2 4.00.1111* (4.00.950B) 8/24/96
;OEM Service Release 2.1 4.03.1212-1214* (4.00.950B) 8/24/96-8/27/97
;OEM Service Release 2.5 4.03.1214* (4.00.950C) 8/24/96-11/18/97
;Windows 98 retail, OEM 4.10.1998 5/11/98
;Windows 98, Security CD 4.10.1998A
;Windows 98 Second Edition 4.10.2222A 4/23/99
;Windows 98 SE Security CD 4.10.2222B
;Windows Me 4.90.3000 6/08/00
;Windows Me Security CD 4.90.3000A
;Windows 2000 SP4 5.00.2195
;Windows XP Professional SP2 5.1.2600
;NT4SP1 4.00.1381

.model small
.586
.stack 200h

.data

wrong db 'A Win32 OS is NOT present!!$'
right db 'A Win32 OS is present.$'
.code

start:
mov ax,@data
mov ds,ax
mov ax, 160ah
int 2fh
; First check to see if we running under any Win version
cmp ax, 0 ; returns 0 if supported.
jnz no_windoze
cmp bh,4 ; Windows OS for Win 95+ use major versions of
jl no_windoze ; 4 or 5

mov ah,9
lea dx,right
int 21h
mov ax,4c00h
int 21h

no_windoze:
Posted on 2004-09-11 14:31:53 by skywalker