You are currently offline, waiting for your internet to reconnect

Requesting MS-DOS Version Number with DEBUG

This article was previously published under Q75195
This article has been archived. It is offered "as is" and will no longer be updated.
The following Debug script will allow you to request the MS-DOSversion from the MS-DOS kernel (MSDOS.SYS). With some versions ofMS-DOS, the VER command and COMMAND.COM's startup banner display adifferent version number than the kernel.

Programs, including MS-DOS 5 Upgrade SETUP.EXE, use this method todetermine the MS-DOS version.
The text in the center column is the required user input, followed bypressing ENTER. The items on the left are what Debug will return (thevalues to the left of the colon will not be an exact match to theexample). The right column contains comments.
Debug           UserResponse        Input           Comments--------        -----           --------C:\>            debug           ; Start the Debug utility-               rax             ; Displays and alters contents in AXAX 0000                         ; Current value in AX:               3000            ; Set function 30h in AH for Int 21-               a 100           ; Assemble starting at 10016A0:0100       int 21          ; General MS-DOS services16A0:0102       int 20          ; End MS-DOS services16A0:0104       ENTER-               p               ; Proceed				
After the final step, the true MS-DOS version number will be returned inthe AX register, as follows:
AX=0005  BX=FF00  CX=0000  DX=0000  SP=FFEE  BP=0000  SI=0000  DI=0000DS=16A0  ES=16A0  SS=16A0  CS=16A0  IP=0102   NV UP EI PL NZ NA PO NC16A0:0102 CD20          INT     20-               q               ; quit debug				
The number in the AX register is in hexadecimal and in reverse order.So, if AX=0A02, it is MS-DOS version 2.1, or if AX=0005, it is MS-DOSversion 5.0. The hexadecimal conversion is as follows:

0-9 hexadecimal = 0-9 decimal


If AX=0A02, reverse the pairs to:               02 0AConvert these hex numbers to decimal numbers:   02 10The MS-DOS version number is:                   2.10				

"Microsoft MS-DOS User's Guide and Reference," version 5.0, pages399-431

"Supercharging MS-DOS," Appendix E, Microsoft Press

"The New Peter Norton Programmer's Guide to the PC & PS/2," AppendixB, Microsoft Press
3.00 3.10 3.20 3.30 3.30a 4.00 4.00a 5.00 5.00a

Article ID: 75195 - Last Review: 10/07/2013 00:46:41 - Revision: 3.0

Microsoft MS-DOS 3.1, Microsoft MS-DOS 3.2 Standard Edition, Microsoft MS-DOS 3.21 Standard Edition, Microsoft MS-DOS 3.3 Standard Edition, Microsoft MS-DOS 3.3a, Microsoft MS-DOS 4.0 Standard Edition, Microsoft MS-DOS 4.01 Standard Edition, Microsoft MS-DOS 5.0 Standard Edition, Microsoft MS-DOS 6.0 Standard Edition

  • kbnosurvey kbarchive KB75195