home *** CD-ROM | disk | FTP | other *** search
- ;******************************************************************
- ;* SUBS.ASM *
- ;* *
- ;* MASM subroutines for Pascal program PASEXAMP.PAS *
- ;* *
- ;* graf - Set 640 x 200, 2-color graphics mode *
- ;* chkdrv - Check that mouse driver is installed *
- ;* *
- ;* See PASEXAMP.PAS program for information on linking. *
- ;* *
- ;******************************************************************
-
- mdata segment byte public 'data'
-
- msg db "Mouse Driver NOT installed","$"
-
- mdata ends
-
-
- mcode segment para public 'CODE'
- assume cs:mcode
-
- public graf
-
- ; graf - Set 640 x 200, 2-color graphics mode
-
- graf proc far
- push bp
- mov ax, 06h ;Change to graphics
- int 10h ;mode by calling
- pop bp ;Int 10H service
- ret
- graf endp
-
-
- ; chkdrv - Check that mouse driver is installed
-
- public chkdrv
-
- chkdrv proc far
- push bp
- push es
-
- mov ax, 03533h ;get Int 33H
- int 21h ;by calling Int 21
- mov ax, es ;Check segment and
- or ax, bx ;offset of Int 33
- jnz NotInstalled ;vector if 0 or IRET
- cmp byte ptr es:[bx],0cfh ;mouse driver not installed
- jne back ;Exit
-
- NotInstalled:
- mov ax,seg mdata ;Set up DS to
- mov ds,ax ;point to data seg
- mov dx, offset msg ;Get message
- mov ah, 09h ;out to screen
- int 21h
- pop es
- pop bp
- mov ax,04c01h ;Function code for
- int 21h ;end process
-
- back:
- pop es
- pop bp
- ret
- chkdrv endp
-
- mcode ends
- end