Xref: utzoo comp.sys.ibm.pc.programmer:1396 alt.msdos.programmer:1618 Path: 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> Organization: Octopus Enterprises, Cupertino CA Lines: 38 In-Reply-To: <1371.26461650@miavx1.acs.muohio.edu> To: rjlewis@miavx1.acs.muohio.edu In article <1371.26461650@miavx1.acs.muohio.edu> you write: >In article , 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] IRET -------------------------------------------------------------------------------- Steve Resnick - 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 --------------------------------------------------------------------------------