🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #495

Re: Interrupt Handlers

#495
From: Mocker
Date: Wed, 30 May 1990 20:27
44 lines
2064 bytes
In article <1990May30.182420.14595@athena.mit.edu> news@athena.mit.edu (News system) writes:

>   I am trying to write an interrupt handler to trap some but not all of the
>   of the Int 21h functions (6 and 0B).  What is the proper way to pass calls
>   to the old handler for functions I don't want to trap?
>   I'm able to trap Int 5 (print screen), chain to the old prt scr, and restore
>   it but when I try to do the same thing for Int 21h my machine hangs.
>   Add to this the complication that I've never written asm for MSDOS before (but
>   I am familiar with interrupt schemes on other processors).
>   Thanks in advance even if it is only a good reference I can go to (Microsoft
>   Press' Advanced MSDOS Programming by Ray Duncan had almost but not quite every
>   thing I need.
>   Chris Cimino, MD    Internet: ccimino@hstbme.mit.edu
>   From: ccimino@hstbme.mit.edu (c cimino)
>   Path: hstbme.mit.edu!ccimino


How about somethig like this:

OLD21_ADDR	DD	?	; YOU HAVE TO GET THIS ADDRESS

INT21_HANDLER	PROC	FAR
	PUSHF
	CMP	AH,6
	JZ	SPECIAL
	CMP	AH,0BH
	JZ	SPECIAL
	
GOTO_OLD_INT21:
	POPF
	JMP	DWORD PTR CS:OLD21_ADDR

SPECIAL:
	POPF
	; INSERT YOUR JUNK HERE
	IRET
INT21_HANDLER	ENDP


...JUST A THOUGHT...
--
there's still lofty dreams...| 6600mock@ucsbuxa.ucsb.edu 
meager desires...            | mocker@cs.ucsb.edu
still sillyness...           | Joseph D. Mocker
Technical Details
Message-ID: <5552@hub.ucsb.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!usc!ucsd!hub.ucsb.edu!mocker
References: <60997@sgi.sgi.com> <577@fnx.UUCP> <1990May30.182420.14595@athena.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!usc!ucsd!hub.ucsb.edu!mocker
From: mocker@tomato.ucsb.edu (Mocker)
Newsgroups: alt.msdos.programmer,comp.sys.ibm.pc,comp.sys.ibm.pc.programmer
Subject: Re: Interrupt Handlers
Message-ID: <5552@hub.ucsb.edu>
Date: 30 May 90 20:27:41 GMT
References: <60997@sgi.sgi.com> <577@fnx.UUCP>
 <1990May30.182420.14595@athena.mit.edu>
Sender: news@hub.ucsb.edu
Reply-To: mocker@cornu.ucsb.edu
Distribution: usa
Organization: UC Santa Barbara Computer Science
Lines: 44
In-reply-to: news@athena.mit.edu's message of 30 May 90 18:24:20 GMT