[comp.sys.mac.programmer] Another LSP question: Trap $0 ??

ra_robert@gsbacd.uchicago.edu (07/05/89)

Many thanks to those who helped me with my last question.  I have another one:
when I run my app from the Finder I keep breaking into TMON with "TRAP $0".  I
rebuilt the app turning off overflow and range checking, and it ran fine.  Is
TRAP $0 some sort of range checking?  (My assembly isn't that good (yet)).  My
app seems to work fine when range/overflow checking is off, so is it likely to
crash sometime if it generates these traps when running with checking on? (I
haven't explicitly "fooled" Pascal anywhere in my code by going outside an
array range).

 
Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

ra_robert@gsbacd.uchicago.edu (07/05/89)

I figured out that there _was_ an error in my code, and I would have probably
encountered problems eventually.  So that answers my first question (sorry for
wasting bandwidth on it).

But I'm still curious about exactly what TRAP $0 is in LSP?  Is it for checking
range errors, or overflow errors, or what?  At the 68k level, how does this
work?  There seem to be TRAP $0's sprinkled throughout my code.

Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

siegel@endor.harvard.edu (Rich Siegel) (07/05/89)

In article <4251@tank.uchicago.edu> ra_robert@gsbacd.uchicago.edu writes:
>Many thanks to those who helped me with my last question.  I have another one:
>when I run my app from the Finder I keep breaking into TMON with "TRAP $0".  I
>rebuilt the app turning off overflow and range checking, and it ran fine.  Is

	If it is in fact an overflow or range violation, you'll get an
appropriate runtime error when running under then environment.

R.




~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

 I classify myself as a real developer because my desk is hip-deep in
 assembly-language listings and I spend more than 50% of my time in TMON.

~~~~~~~~~~~~~~~