Article View: comp.sys.mac
Article #13663Re: MacWrite on 68020
From: Tim Maroney
Date: Mon, 01 Dec 1986 23:41
Date: Mon, 01 Dec 1986 23:41
27 lines
2152 bytes
2152 bytes
To the best of my knowledge, it is not correct that MacWrite calls the ROM
directly, or it wouldn't even work on the new ROMs. The compatibility
problem comes from its use of the TRAP #n instructions of the 68000. It
installs its own handlers for nine of these traps, which are unused by the
Mac OS. These are totally different from the A-traps used for system calls
on the Mac, which are handled through the illegal instruction handler.
Check the 68000 manual if you're interested. The TRAP #n instructions are
normally for operating system use, and are not intended to be used by
application processes. For instance, most 68000 UNIX implementations
dispatch system calls using TRAP #0.
The compatibility problem is that the exception stack frames for the
processors are different. This makes the special-purpose TRAP #n exception
handlers installed by MacWrite incorrect on the 68010 and 68020. This is
why Apple specifically reserves all sixteen traps in the future architecture
compatibility guidelines; which, to be fair, are more recent than MacWrite.
Needless to say, this is bad programming practice. Using TRAP #n for
frequently-used routines is doing an easy thing in a hard way. There is no
good reason not to merely link the routines, and use JSR's. In fact, this
is probably a good deal faster than going through exception handling. But
no doubt the programmer thought it was very clever to do things this way:
the age-old problem.
--
Tim Maroney, Electronic Village Idiot
{ihnp4,sun,well,ptsfa,lll-crg,frog}!hoptoad!tim (uucp)
hoptoad!tim@lll-crg (arpa)
Technical Details
Message-ID:
<1372@hoptoad.uucp>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!hoptoad!timReferences:
<MS.V3.18.rs4u.80020c10.mcmurray.ibm032.4598.14@andrew.cmu.edu>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac Subject: Re: MacWrite on 68020 Message-ID: <1372@hoptoad.uucp> Date: Mon, 1-Dec-86 18:41:49 EST Article-I.D.: hoptoad.1372 Posted: Mon Dec 1 18:41:49 1986 Date-Received: Tue, 2-Dec-86 01:00:18 EST References: <MS.V3.18.rs4u.80020c10.mcmurray.ibm032.4598.14@andrew.cmu.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Centram Systems, Berkeley Lines: 27