home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12351 < prev    next >
Encoding:
Text File  |  1992-08-15  |  1.6 KB  |  41 lines

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