qa.hlp (Table of Contents; Topic list)
GetVer
   Example  Back  Contents  Index
──────────────────────────────────────────────────────────────────────────────
 
;* GetVer - Gets DOS version.
;*
;* Shows:   DOS Function - 30h (Get MS-DOS Version Number)
;*
;* Params:  None
;*
;* Return:  Short integer of form (M*100)+m, where M is major
;*          version number and m is minor version, or 0 if
;*          DOS version earlier than 2.0
 
GetVer  PROC
 
        mov     ah, 30h                 ; DOS Function 30h
        int     21h                     ; Get MS-DOS Version Number
        cmp     al, 0                   ; DOS version 2.0 or later?
        jne     @F                      ; Yes?  Continue
        sub     ax, ax                  ; No?  Set AX = 0
        jmp     SHORT exit              ;   and exit
@@:     sub     ch, ch                  ; Zero CH and move minor
        mov     cl, ah                  ;   version number into CX
        mov     bl, 100
        mul     bl                      ; Multiply major by 10
        add     ax, cx                  ; Add minor to major*10
exit:   ret                             ; Return result in AX
 
GetVer  ENDP
                                    -♦-