Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Function 30H (decimal 48) returns the DOS major and minor version numbers.
  The major version number is in AL, and the minor version number is in AH;
  BX and CX contain a serial number (0 in IBM's versions of DOS; other
  possible values in non-IBM versions). For example, if you execute function
  30H in DOS version 3.3, the function returns AL = 03H (the major version
  number), AH = 1EH (30, the minor version number), BX = 00H, and CX = 00H.
  In the OS/2 compatibility box, function 30H returns AL = 0AH; that is, the
  major version number is 10.

  In DOS version 1, function 30H was unsupported. Nevertheless, you can
  still test for DOS version 1 by executing function 30H; in DOS version 1,
  function 30H is guaranteed to return AL = 00H. Thus, a simple test of the
  value returned in AL is sufficient to distinguish between version 1 and
  later versions:

  mov ah,30h              ; AH = 30H (interrupt 21H function number)
  int 21h                 ; get DOS version number
  cmp al,2
  jl  EarlyVersion        ; jump if DOS version 1

  Any program that uses interrupt 21H functions with numbers above 2EH can
  use function 30H to determine if the appropriate DOS version is being
  used.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson