home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: adsp.sw,comp.sys.amiga.programmer
- Path: sparky!uunet!munnari.oz.au!mips!mips!darwin.sura.net!wupost!gumby!destroyer!ubc-cs!newsserver.sfu.ca!sfu.ca!epang
- From: epang@fraser.sfu.ca (Eugene Pang)
- Subject: Re: Exception handler example
- Message-ID: <epang.713916164@sfu.ca>
- Sender: news@sfu.ca
- Organization: Simon Fraser University, Burnaby, B.C., Canada
- References: <kehlet.065m@kehlet.adsp.sub.org>
- Distribution: adsp,world
- Date: Sat, 15 Aug 1992 22:02:44 GMT
- Lines: 28
-
- kehlet@kehlet.adsp.sub.org (Jesper Kehlet) writes:
- >[...]
- >If you are interested in just using it [the example posted] as-is, it sets up
- >a division by zero exception handler for the purpose of trapping exception #5
- >[...]
-
- >It is *NOT* mathematically correct, since simple math tells us, that it IS
- >illegal, but I have reasoned with the fact, that the closer the denominator
- >goes to zero, the higher the result of the division -- the numerator does
- >really matter, except for going against zero from the positive or negative
- >side -- I use the numerator to determine the sign of the operation.
-
- You should also remind people that it's only for the DIVU/DIVS divide by
- zero exceptions. It doesn't handle the DIVSL & DIVUL (32 bit) divide
- instructions (found on the '020 and above).
-
- To add support would involve more than what I'm going to go into, but it would
- start with the following btst's:
-
- #6 - 1==DIVU/DIVS
- #8 - 1==DIVS
- - 0==DIVU
- 0==DIVSL/DIVUL
- #11 - 1==DIVSL
- 0==DIVUL
-
- Then there's testing for 32 bit or 64 bit dividend, which register to store
- the result, ... Certainly doable, but I'm not volunteering. :-)
-