Advertisement Jump to content


This topic is now archived and is closed to further replies.


Catching exceptions in Watcom C++

This topic is 7062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
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

Share this post

Link to post
Share on other sites
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?


Share this post

Link to post
Share on other sites
try looking up

try {

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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!