
016/018 01 Aug 90 12:07:00
From:   Mark Johnston
To:     Darryl Gregorash
Subj:   Re: Game ports and timers
Attr:   
------------------------------------------------
 [ ... continued from previous message ]

----------- cut here ------------
;C routine void install(void)
;installs int8 interrupt handler and sets system clock to 200/sec
;
               public      _install
_install       proc        near
               push        bp
               mov         bp, sp
;
               push        ds
               push        cs
               pop         ds
               push        es
               push        bx
               push        ax
               mov         ax, 3508h
               int         21h                          ;save old int 8 vector
               mov         word ptr org_int8_addr, bx
               mov         word ptr org_int8_addr+2, es
               mov         ah, 25h
               mov         dx, offset new_int8_entry
               int         21h                          ;point vector to my
               pushf                                    ;routine
               cli
               mov         al, 36h
               out         43h, al         ;program timer 0 (port 40h)
               add         al, 4eh
               out         40h, al
               mov         al, 17h         ;1.193182d/174eh
               out         40h, al         ;is approx. 200
               mov         go_8_switch, on
               popf
               pop         ax
               pop         bx
               pop         es
               pop         ds
               pop         bp
               ret
_install       endp
;
;C routine void uninstall(void)
;uninstalls new int8 driver and returns system clock to normal speed
;
               public      _uninstall
_uninstall     proc        near
               push        bp
               mov         bp, sp
               push        ds
               push        ax
               push        cs
               pop         ds
               pushf
               cli
               mov         go_8_switch, off
               mov         al, 36h
               out         43h, al             ;program timer 0
               mov         al, 0ffh
               out         40h, al             ;1.193182d/0ffffh
               out         40h, al             ;is approx 18.2
               popf
               push        dx
               mov         dx, org_int8_addr+2 
               mov         ds, dx
               mov         dx, cs:org_int8_addr
               mov         ax, 2508h
               int         21h                 ;point int 8 to its old location 
                                                                                
                                                                                
               
                                                                                
                                                                                
                                                                                
               
 
               pop         dx
               pop         ax
               pop         ds
               pop         bp
               ret
_uninstall     endp
;
        end
----------- cut here ------------

     I hope this helps.  My system doesn't  allow  file
requests,  but  I  would be more than happy to continue
this  discussion  here  (moderator  willing)   or   via
netmail.
     bfn,

 #|v > Mark


--- Qtach2 v1.02 U4
 * Origin: =# The QNX Telegraph #=  Tacoma WA  (206)535-6109 (1:138/110)

