home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MOUSE / MSMOUSE1.ZIP / PAS.ZIP / SUBS.ASM < prev   
Encoding:
Assembly Source File  |  1989-02-10  |  2.6 KB  |  71 lines

  1. ;******************************************************************
  2. ;*  SUBS.ASM                                                      *
  3. ;*                                                                *
  4. ;*  MASM subroutines for Pascal program PASEXAMP.PAS              *
  5. ;*                                                                *
  6. ;*  graf - Set 640 x 200, 2-color graphics mode                   *
  7. ;*  chkdrv - Check that mouse driver is installed                 *
  8. ;*                                                                *
  9. ;*  See PASEXAMP.PAS program for information on linking.          *
  10. ;*                                                                *
  11. ;******************************************************************
  12.  
  13. mdata           segment byte public 'data'
  14.  
  15.                 msg     db   "Mouse Driver NOT installed","$"
  16.  
  17. mdata           ends
  18.  
  19.  
  20. mcode           segment para public 'CODE'
  21.                 assume  cs:mcode
  22.  
  23.                 public  graf
  24.  
  25. ; graf - Set 640 x 200, 2-color graphics mode
  26.  
  27. graf            proc    far
  28.                 push    bp
  29.                 mov     ax, 06h                 ;Change to graphics
  30.                 int     10h                     ;mode by calling
  31.                 pop     bp                      ;Int 10H service
  32.                 ret
  33. graf            endp
  34.  
  35.  
  36. ; chkdrv - Check that mouse driver is installed
  37.  
  38.                 public  chkdrv
  39.  
  40. chkdrv          proc    far
  41.                 push    bp
  42.                 push    es
  43.  
  44.                 mov     ax, 03533h              ;get Int 33H
  45.                 int     21h                     ;by calling Int 21
  46.                 mov     ax, es                  ;Check segment and
  47.                 or      ax, bx                  ;offset of Int 33
  48.                 jnz     NotInstalled            ;vector if 0 or IRET
  49.                 cmp     byte ptr es:[bx],0cfh   ;mouse driver not installed
  50.                 jne     back                    ;Exit
  51.  
  52. NotInstalled:
  53.                 mov     ax,seg mdata            ;Set up DS to
  54.                 mov     ds,ax                   ;point to data seg
  55.                 mov     dx, offset msg          ;Get message
  56.                 mov     ah, 09h                 ;out to screen
  57.                 int     21h
  58.                 pop     es
  59.                 pop     bp
  60.                 mov     ax,04c01h               ;Function code for
  61.                 int     21h                     ;end process
  62.  
  63.         back:
  64.                 pop     es
  65.                 pop     bp
  66.                 ret
  67. chkdrv          endp
  68.  
  69. mcode           ends
  70.                 end
  71.