home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / dos / bdos_xr5.arj / VFOSSIL / VFOS_SRC.ZIP / INT14.INC < prev    next >
Encoding:
Text File  |  1992-12-12  |  2.7 KB  |  112 lines

  1.         subttl Interrupt 14H dispatcher
  2.         page +
  3.  
  4. ;
  5. ; VFOS_IBM VFOSSIL driver by Bob Hartman.
  6. ; Copyright 1988 by Spark Software.  ALL RIGHTS RESERVED.
  7. ;
  8.  
  9. vfos_entry proc far
  10.         push    cx
  11.         push    dx
  12.         push    si
  13.         push    di
  14.         push    ds
  15.         push    es
  16.  
  17.         push    cs
  18.         pop     ds
  19.  
  20.         cmp     al,0
  21.         jne     not_0
  22.  
  23. ; do subfunction 0
  24.         mov     si,offset vfos_info
  25.         mov     cx,8
  26.         repz    movsb
  27.         mov     ah,3
  28.         mov     bh,0
  29.         int     10h
  30.         xor     ah,ah
  31.         mov     al,ch
  32.         mov     curs_info.curs_start,ax
  33.         mov     al,cl
  34.         mov     curs_info.curs_end,ax
  35.         mov     ax,1954h
  36.         jmp     SHORT done_14
  37.  
  38. not_0:
  39.         cmp     al,1
  40.         jne     not_1
  41.         cmp     cx,FUNCNT*4
  42.         jbe     cx_ok
  43.         mov     cx,FUNCNT*4
  44. cx_ok:
  45.         mov     si,offset FUNCTBL
  46.         repz    movsb
  47.  
  48.         mov     ax, 0500h                 ; select page 0           (*JZ*)
  49.         int     10h
  50.         mov     ax,adapter_base
  51.         mov     es,ax
  52.         mov     ah,0feh                   ; fetch video buffer segment
  53.         int     10h
  54.         mov     ax,es
  55.         mov     adapter_base,ax
  56.  
  57. ; set up correct video parameters                                   (*JZ*)
  58.         mov     ax,40h                    ; BIOS data segment
  59.         mov     es,ax
  60.         mov     ax,es:[4Ah]               ; get number of screen columns
  61.         mov     mode_info.mode_cols,ax
  62.         xor     ah,ah
  63.         mov     al,es:[84h]               ; get number of screen rows
  64.         cmp     al,24                     ; more than 25?
  65.         jle     norow                     ; no, don't change anything
  66.         inc     al
  67.         mov     mode_info.mode_rows,ax
  68. norow:
  69.  
  70.         mov     ax,1954h
  71.         mov     bh,FUNCNT
  72.         jmp     SHORT done_14
  73.  
  74. not_1:
  75.         cmp     al,2
  76.         jne     not_2
  77.         mov     ax,1954h
  78.         jmp     SHORT done_14
  79.  
  80. not_2:
  81.         cmp     al,3
  82.         jne     not_3
  83.  
  84. ; remove ourselves from the FOSSIL chain
  85.         push    cs
  86.         pop     es
  87.         mov     ah,7fh                  ; deinstall application code
  88.         mov     al,81h                  ; VFOSSIL code
  89.         mov     dx,offset vfos_entry    ; offset of entry point (es ok)
  90.         int     14h                     ; initialize it
  91.  
  92. ; free PSP so we go away
  93.         mov     ah,49h
  94.         int     21h
  95.         mov     ax,1954h
  96.         jmp     SHORT done_14
  97.  
  98. not_3:
  99.         mov     ax,0ffffh
  100.         jmp     SHORT done_14
  101.  
  102. done_14:
  103.         pop     es
  104.         pop     ds
  105.         pop     di
  106.         pop     si
  107.         pop     dx
  108.         pop     cx
  109.  
  110.         ret
  111. vfos_entry endp
  112.