home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
dosvers.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-21
|
2KB
|
70 lines
; Function: DOSVERS.ASM
;
; By Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
; Syntax: m_dos = DOSVERS()
; Return: <expC> = version of user's DOS
;----------------------------------------------------------------
PUBLIC DOSVERS
EXTRN __RETC:FAR
_DATA SEGMENT WORD PUBLIC 'DATA'
VERSTR DB "0.00"
DOS1 DB "1.xx"
_DATA ENDS
DOSVERS_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:DOSVERS_TEXT, DS:_DATA
DOSVERS PROC FAR
PUSH SI
MOV AH,30H
INT 21H ; Get DOS version.
OR AL,AL ; If AL is 0, it's DOS 1.something
JZ BADDOS
LEA SI, VERSTR
PUSH AX
XOR AH,AH
AAM ; Convert AL to decimal digits in AH and AL
ADD AL,30H
MOV [SI],AL ; And store in string area
INC SI
MOV AL,'.' ; Decimal point
MOV [SI],AL
INC SI
POP AX
XCHG AH,AL
XOR AH,AH
AAM ; Convert minor version number
; to decimal digits
ADD AH,30H
ADD AL,30H
MOV [SI],AH ; and store in return string
INC SI
MOV [SI],AL
INC SI
XOR AL,AL
MOV [SI],AL
LEA SI, VERSTR
JMP SHORT RETURN
;
BADDOS: LEA SI, DOS1 ; return '1.xx'
;
RETURN: PUSH DS
PUSH SI
CALL __RETC
ADD SP,4
POP SI
RETF
DOSVERS ENDP
DOSVERS_TEXT ENDS
END
;--------------------------------------------------------------------------
;***************************************
END