push bp mov bp, sp ; needs to be &H8B, &HEC pushf 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 popf pop bp retf 4