🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #455

Re: which timer interrupt?

#455
From: Steve Resnick
Date: Wed, 09 May 1990 16:42
37 lines
2345 bytes
In article <1371.26461650@miavx1.acs.muohio.edu> you write:
>In article <j45cvma7f@tmsoft.uucp>, mshiels@tmsoft.uucp (Michael A. Shiels) writes:
>  I understand why you hook INT 8h, but how do you call the Original Int 8h
>handler, and have it RETURN to your code?  If you call the original int 8h 
>handler, it'll end with a IRET, and won't it bounce back to the currently 
>executing program (and NOT your handler). 

Actually, if you CALL the old ISR it will IRET to some unknown region of memory
because the IRET pops the first word on the stack (SS:SP) to the flags.


The easiest way to call the old timer is to store the old ISR address in 
a DWORD. When you are ready to call the old ISR, push the flags, then
do a far call to the ISR. When the ISR issues it's IRET instruction the 80n86
will pop flags, CS, IP and return to the next instruction after your call.


Example:
OLD08   LABEL   DWORD           ; This is the address used to call the
OLD08OFF        DW      ?       ; old int 08 ISR
OLD08SEG        DW      ?
NEWINT08H:
	PUSHF
	CALL    DWORD PTR CS:[OLD08]
	<Do your processing here>
	IRET

--------------------------------------------------------------------------------
Steve Resnick -<stever@octopus.COM apple!octopus!stever sun!vsi1!octopus!stever>
408/241-1533 Process Scientific, Inc.
--------------------------------------------------------------------------------
"0x2B|~0x2B THAT is the question!"
My views are my own and in no way represent the views of
Octopus Enterprises or Process Scientific, Inc.
--------------------------------------------------------------------------------
Flames, Grammar, and SPELLING errors etc: >/dev/null
--------------------------------------------------------------------------------
Technical Details
Message-ID: <1990May9.164249.9903@Octopus.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!vsi1!octopus!stever
References: <484@wjh12.harvard.edu> <j45cvma7f@tmsoft.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!vsi1!octopus!stever
From: stever@Octopus.COM (Steve Resnick )
Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: Re: which timer interrupt?
Message-ID: <1990May9.164249.9903@Octopus.COM>
Date: 9 May 90 16:42:49 GMT
References: <484@wjh12.harvard.edu> <j45cvma7f@tmsoft.uucp>
Organization: Octopus Enterprises, Cupertino CA
Lines: 38
In-Reply-To: <1371.26461650@miavx1.acs.muohio.edu>
To: rjlewis@miavx1.acs.muohio.edu