Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: MemErr and SetGrowZone on IIci Message-ID: <47484@apple.Apple.COM> Date: 19 Dec 90 01:31:05 GMT References: <1CE00001.1p63kl@tbomb.ice.com> Organization: Apple Computer Inc., Cupertino, CA Lines: 49 In article <1CE00001.1p63kl@tbomb.ice.com> time@tbomb.ice.com writes: > >In article <22228@well.sf.ca.us>, gurgle@well.sf.ca.us (Pete Gontier) writes: >> In (thinly) related news, we spent hours trying to track down the misbehavior >> of the low memory global MemErr after a call to SetGrowZone. We had >> in MacsBug, the instruction 'TST.W MemErr' listed. We'd do a 'dw MemErr' and >> get an error code we'd never seen before and wasn't listed anywhere. After > >This error code was nothing of the sort. It is a pointer to something >and when looked at as a short appears to be a boagus error code. > >> single-stepping the TST, we'd do another 'dw MemErr' and it would turn >> out to have CHANGED to 0. We finally decided that on the IIci, there >> was something wrong with the MMU, because this behavior did not appear on >> other machines. Anybody ever seen or heard of anything like this? > >I presume you meant 'dm MemErr' (MacsBug right?). The MemErr global >is set by the glue code used to implement the SetGrowZone() in your >high level language (MPW or Think?). Why the TST.W would affect this >MemErr value I do not know, unless you missed some other code hitting >it. Sounds like you stepped right through the one instruction properly, >so it does sound a little wierd. Maybe, because the glue code is supposed >to treat this as a procedure (no return value) it is setting MemErr >to noErr to clean up. Tim, "dw xxxx" should work fine in Macsbug. "dw" stands for Display Word. Also, I think that this whole thing with MemErr getting set to zero was the result of a bug in MacsBug. Macsbug would make a call to the Graphics Device Manager, which would make a call to the Memory Manager, which would set MemErr. Therefore, it was Macsbug that was clearing MemErr. I'm not sure what versions of Macsbug suffer from the bug. BTW: I don't know if this is true about SetGrowZone specifically, but on all ROMs subsequent to the 64K ROMs, the Memory Manager sets MemErr itself. Previously, this was done by the high-level glue provided by the development system. In MPW 3.2, this glue has been taken out, along with support for the 64K ROMs. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions