home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / WINER.ZIP / DOSVER.ASM < prev    next >
Assembly Source File  |  1992-05-13  |  861b  |  32 lines

  1. ;DOSVER.ASM, retrieves the DOS version number
  2.  
  3. ;Copyright (c) 1991 Ethan Winer
  4.  
  5. ;Syntax: CALL DOSVer(Version%)
  6. ;Where Version% receives the version times 100
  7.  
  8.  
  9. .Model Medium, Basic
  10. .Code
  11.  
  12. DOSVer Proc, Version:Word
  13.  
  14.   Mov  AH,30h      ;service 30h gets the version
  15.   Int  21h         ;call DOS to do it
  16.  
  17.   Push AX          ;save a copy of the version for later
  18.   Mov  CL,100      ;prepare to multiply AL by 100
  19.   Mul  CL          ;AX is now 300 if running DOS 3.xx
  20.  
  21.   Pop  BX          ;retrieve the version, but in BX
  22.   Mov  BL,BH       ;put the minor part into BL for adding
  23.   Mov  BH,0        ;clear BH, we don't want it anymore
  24.   Add  AX,BX       ;add the major and minor portions
  25.  
  26.   Mov  BX,Version  ;get the address for Version%
  27.   Mov  [BX],AX     ;assign Version% from AX
  28.   Ret              ;return to BASIC
  29.  
  30. DOSVer Endp
  31. End
  32.