Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


interrupt within interrupt

Posted on 1998-10-30
Medium Priority
Last Modified: 2011-09-20
1. how do i issue an interrupt within an interrupt
2. i read omewhere it cant be done .if true why?
3. i tried changing registers directly(eg. _AX=0x3d;)
   and then calling the required interrupt function(eg.   (*int21)(); ) here int21 points to the 0x21 int. vector.
   but it didn't work possibly because the changed regidters   affect the rest of the program
4. if you advise me to copy back the reg. values please specify how?
Question by:the_shrink
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1253908
It is just not true that you can't call an interupt from another interupt. TSR's and interupt hooking modules hook interupts to call other interupts.

What experience do you have with Assembler? Setting AH=0x3D and calling INT 21 should open a file provided that you put the name of the file in DS:DX and the access type in AL.

Also, calling DOS functions from Windows can have spurious results. Windows emulates DOS and not all functionality is completely the same as if run in DOS alone.


Accepted Solution

bculver earned 100 total points
ID: 1253909
Technically issuing an interrupt from within an interrupt handler is just like calling a function from within another function, it can be done. The problems lie in the interrupt handlers themselfs. Int 0x21 is whats called non re-entrant. that is you can not make a  int 0x21 call while your in a  0x21 section of code. For example; if you wrote an interrupt handler, that say saves the ax register to a location, changes the ax reg value and  makes a call to itself, the original ax value will be lost. The same thing happens in a DOS 0x21 handler. But you say your not in an int 0x21 handler, so how can this be! Wrong! the operating system spends most of its life spinning around inside int 0x21 functions and like it or not 99 times outa 100 your interrupt handler was called while  in a  int 0x21 function. Luckily there are actually ways to tell this or TSR's would never have been invented. The problem is that there is no easy solution to what you are tring to do in the space available here. (There have been whole books written on this subject). A good place to start would to disect some TSR code and note the ways that they figure out if they came from within an int 0x21 function. Another is to get ahold of a book call "Undocumented DOS" (sorry don't remember the author) that will help you understand some of the undocumented functions called needed for TSR's to work correctly.

Author Comment

ID: 1253910
THanks to culver

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question