Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bionet!agate!helios.ee.lbl.gov!nosc!humu!uhccux!mikem From: mikem@uhccux.uhcc.hawaii.edu (Mike Morton) Newsgroups: comp.sys.mac.programmer Subject: MacsBug crash when interrupting 68881 operations Keywords: MacsBug 68881 float math-chip Message-ID: <4168@uhccux.uhcc.hawaii.edu> Date: 24 Jun 89 00:28:01 GMT Organization: University of Hawaii Lines: 43 MacsBug seems to have problems interrupting certain math-chip operations. I run this LightspeedC program with 68881 code enabled: main () { register float a = 0, b = 0; while (1) a += b; } When I press the interrupt switch, I get: Spurious Interrupt or Uninitialized Interrupt Vector at 003ED970. *** MacsBug caused the exception *** The code which crashes looks like this (comments are my own, natch): TST.B -$071B(A5) ; have a math-chip installed? BEQ.S *+12 ; no: skip LEA -$023A(A5), A0 ; yes: find a place to... FMOVEM FP0-FP7, (A0) ; ...store the math registers *LEA -$0246(A5), A0 ; and a place for... FMOVEM FPCR/FPSR/FPIAR, (A0) ; ...weird regs The crash is at the starred location. At this point I usually get Bus Errors, etc., if I try to continue. LSC doesn't put a and b into registers unless I declare them double, in which case the problem goes away. The code LSC emits for the float case looks like: l: FMOVE.S -4(A6), FP0 FADD.S -8(A6), FP0 FMOVE.S FP0, -8(A6) BRA.S l My guess is that when there's a lot of traffic between the math chip and memory, interrupts can leave the chip in a state which doesn't like FMOVEMs. Any comments from MacsBug folks at Apple? From '881 hackers? Boring details: SE/30m 4Mb, System 6.0.3, Macsbug 6.1, no inits. Ever try to find anagrams for "MacsBug"? -- Mike Morton // P.O. Box 11378, Honolulu, HI 96828, (808) 676-6966 HST Internet: mikem@uhccux.uhcc.hawaii.edu (anagrams): Mr. Machine Tool; Ethical Mormon; Chosen Immortal; etc.{