Weil mir das mächtig auf den Keks gegangen ist, dass ich die DOS Version nicht bei Concurrent DOS Versionen (egal welche) und auch bei DOS Plus angezeigt bekomme,
sondern nur die jeweilige Programmversion des Herstellers, hier mal Quick & Dirty die Versionsabfrage als Mini-Programm und mit MASM source code.
Die minor DOS version wird nicht als dezimale Zahl angezeigt, sondern als Hex Wert. War mir im 1. Schritt zu aufwendig, werde ich später schöner machen.
Hier der MASM Quellcode:
;===================================
; File: Show DOS version but without
; dependencies from running DOS
; Author: Peter Dassow
; for forum.classic-computing.de
; Assembler: MASM 6.0
; Output as COM file,
; so LINK with /TINY option !
;===================================
;
.MODEL TINY ; COM-file !
.RADIX 16 ; all numbers as hexadecimal values
.CODE
ORG 0100 ; Start address for COM
;
DOSVer: MOV AH,09 ; display string
MOV DX,OFFSET STEXT ; address of text
INT 21 ; main DOS interrupt
MOV AH,30 ; get DOS version
INT 21 ; main DOS interrupt
;
CMP AL,2 ; is it lower than DOS 2.0 ?
JB DOS1
MOV BX,AX ; save the content of AX !
ADD AL,30 ; add value of ASCII code "0"
MOV BYTE PTR [MAJOR],AL ; write the char in offset address MAJOR
MOV AH,09 ; display string
MOV DX,OFFSET DISP1 ; address of text
INT 21 ; main DOS interrupt
;
MOV AL,BH ; move saved minor version number into register AL
AND AL,0F ; just the lower half byte
ADD AL,30 ; add value of ASCII code "0"
CMP AL,39 ; is it higher than "9" ?
JBE ISLO1 ; it is below or equal "9" so go to ISLO1
ADD AL,07 ; subtract ASCII code offset of "A"-"0"
ISLO1: MOV BYTE PTR [MINOR2],AL ; write content of AL to an address
; now go on with 2nd half byte
MOV AL, BH ; move saved minor version number into regsiter AL
MOV CL,4 ; bit count 4
SHR AL,CL ; shift right CL bits = just the higher half byte
ADD AL,30 ; add value of ASCII code "0"
CMP AL,39 ; is it higher than "9" ?
JBE ISLO2 ; it is below or equal "9" so go to ISLO2
ADD AL,07 ; subtract ASCII code offset of "A"-"0"
ISLO2: MOV BYTE PTR [MINOR1],AL ; write content of AL to an address
MOV AH,09 ; display string
MOV DX,OFFSET DISP2
INT 21 ; main DOS interrupt
;
MOV AX,4C00 ; DOS terminate program with exit code
INT 21 ; main DOS interrupt
DOS1: MOV AH,09 ; display string
MOV DX,OFFSET TOOLOW
INT 21 ; main DOS interrupt
INT 20 ; old DOS terminate program
;
;
; Start message
STEXT BYTE "Show DOS version (P. Dassow 2020),", 0D, 0A
BYTE "as an example for forum.classic-computing.de"
BYTE 0D, 0A, "$"
DISP1 BYTE "Major DOS version number: "
MAJOR BYTE "X"
BYTE 0D, 0A, "$"
DISP2 BYTE "Minor DOS version number: "
MINOR1 BYTE "Y"
MINOR2 BYTE "Z"
BYTE 0D, 0A, "$"
TOOLOW BYTE "DOS Version lower than 2.0.",0D,0A,"$"
;
END DOSVer
Probelauf mit DOS 3.30:
C:\MASM>VERSION
Show DOS version (P. Dassow 2020),
as an example for forum.classic-computing.de
Major DOS version number: 3
Minor DOS version number: 1E
C:\MASM>_
Der Linker (LINK.EXE) muss mit der Option /TINY aufgerufen werden, sonst wird eine (kaputte) .EXE erzeugt.
In der ZIP Datei ist auch die assemblierte und ausführbare .COM Datei - sehr klein weil halt Assembler und nicht Hochsprache.
Kann hier jeder als Einführung in den x86 Assember nutzen