diff options
Diffstat (limited to 'asm')
-rw-r--r-- | asm/dosver.asm | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/asm/dosver.asm b/asm/dosver.asm new file mode 100644 index 0000000..8406663 --- /dev/null +++ b/asm/dosver.asm @@ -0,0 +1,76 @@ + push bp
+ mov bp, sp
+
+ mov al, 0
+ mov ah, 0x30
+
+ int 0x21
+
+ ; Push actual version info onto stack
+ push ax
+
+ cmp bh, 0x00
+ jne notdrdos
+
+ ; Check if it is DR_DOS lying about being PC_DOS
+ mov ax, 0x4452
+ int 0x21
+ jc notdrdos
+
+ ; Mark drdos as 0xee
+ mov bh, 0xee
+
+ ; clear the stack in a meaningless way
+ pop cx
+
+ ; DrDos version, or something like it, is already in the ax reggy
+ jmp alldone
+
+
+notdrdos:
+ ; pop the actual version into ax now that we're done
+ ; with drdos checks
+ pop ax
+
+ cmp al, 5
+ je five
+
+ ; if al is still zero, it's dos 1
+ cmp al, 0
+ jne alldone
+
+ ; Mark it as MS-DOS 1.0
+ mov al, 1
+ mov ah, 0
+ mov bh, 0xFF
+ jmp alldone
+
+five:
+ ; Store the OEM version
+ push bx
+
+ mov ax, 0x3306
+ int 0x21
+
+ ; True version should have been in bx
+ push bx
+ pop ax
+ pop bx
+
+alldone:
+
+ mov cl, 8
+ shr bx, cl
+ xor bh, bh
+
+ ; second argument - OEM code in high byte
+ mov di, [bp]+6
+ mov [di], bx
+
+ ; first argument - major (al) minor(ah) versions
+ mov di, [bp]+8
+ mov [di], ax
+
+ pop bp
+ retf 4
+
\ No newline at end of file |