Catching exceptions in Watcom C++

Started by
1 comment, last by FlyFire 24 years, 7 months ago
Exceptions cause an interrupt when they occur i think. the first 256 of memory on the computer is the interrupt vector table, it's
a list of 32bit pointer to the handlers for
each of the interrupts. watcom has some functions for chaining interrupt handlers to your own functions. scout around the help files. the process may be a little different for exceptions, it may require a few assembly language calls to esoteric cpu registers.. not sure... I know that divide by zero can be handled just by replacing an interrupt handler. it is possible to change the interrupt handlers manually by poking around the table, but in a protected mode program i wouldnt advise it, because the dos extender needs to know which are real mode, and which are protected mode so it can switch back and forth when the interrupts are triggered.
hope this helps
Grommit
Advertisement
This question may be more optional than catching exceptions only in Watcom C++
Although, how can i write my own exception handler to catch any fatal exceptions that cause to program termination?

------------------
FlyFire/CodeX
http://codexorg.webjump.com

try looking up

try {
}
except

or something like that. I remember seeing it somewhere in the help documentation... if i see it again, i'll give you a shout.

//try {} except {} lets you safely run code. If the code causes an exception, rather than having the code bail out on you, you are given a chance to correct the error, and continuing without having the user know.

Jonathan Makqueasy gamesgate 88[email=jon.mak@utoronto.ca]email[/email]

This topic is closed to new replies.

Advertisement