[comp.sys.mac] Bug in Inside Mac

drc@dbase.UUCP (10/02/87)

Inside Macintosh should be updated on page I-380 to document that the
routine whose address is in TERec.wordBreak must preserve registers D1 and D2,
just as that page documents that TERec.clikLoop must preserve D2.

In the SE ROM, for instance, the caller of the word break
routine saves and restores D0/A0/A1 at 41167A and 41168C, but on its return
registers D1 and D2 are assumed preserved by instructions at 41164E and 411652.

In the meantime, I would recommend that anyone who is writing a custom wordbreak
function include inline code to save D1 and D2 at the beginning of their
routine and code to restore it at the end.  So far every compiler I have tried
has the same shortcoming in their Toolbox Interface libraries although some of
them (Semper, TML, Borland, and Think) will probably be updating their interface
code to save and restore the registers.  Don't flame the compiler manufacturers,
this shortcoming also exists in MPW (I have been informed that it is in the
Toolbox Interface Source Code which is licensed from Apple).

It is not clear at this point whether the anomaly is in the documentation (Inside
Mac) or the code licensed from Apple.

Dennis Cohen
Ashton-Tate Glendale Development Center
dBASE Mac Development Team
--------------------------
Disclaimer: All opinions expressed above are my own. I don't know what (if any)
opinions my employer might have.