Microsoft KB Archive/31291

Mouse CHKDRV.ASM Correction PSS ID Number: Q31291 Article last modified on 05-14-1993 PSS database name: H_Mouse

1.00 1.01

MS-DOS

Summary:

The “Microsoft Mouse Programmer’s Reference Guide” lists an assembly-language routine named CHKDRV.ASM on Pages 7-9. This code is intended to check for the presence of the Microsoft Mouse driver in memory. However, the list provided is incorrect.

The following is the correct version of the code:


 * MCHK2.ASM ;A correction of the chkdrv procedure listed in the 1986 ;Microsoft Mouse Programmer’s Reference Guide. This revision ;is intended for incorporation in small model C ;applications. mdata segment byte public ‘data’ msg db “Mouse driver NOT installed.”,“$”

mdata ends

_TEXT segment para public ‘CODE’ assume cs:_TEXT

public _chkdrv _chkdrv proc near push bp push es

mov   ax, 03533h          ;Get int 33h via int   21h                 ;int 21h mov   ax,es               ;Check segment, offset or    ax,bx               ;of int 33h vector. If it is 0 or      jz     nomouse             ;pointing to IRET, mouse driver mov   bl,es:[bx]          ;is not installed. cmp   bl,0cfh je    nomouse             ; ! previously a jnz back was ; incorrect jmp   back ;Exit nomouse: mov ax,seg mdata ;Set DS to point to data seg mov ds,ax ; mov dx, offset msg ;Get message mov ah,09h ;Output to screen int 21h pop es pop bp mov ax,04c00h ;Terminate int 21h

back: pop es pop bp ret _chkdrv endp

_TEXT ends end

Additional reference words: docerr

Copyright Microsoft Corporation 1993.