Power Macintosh: 68LC040 Emulator (4/94)

This article describes the 68LC040 emulator found on Power Macintosh.

The 68LC040 emulator provides an environment by which 680x0 applications can execute on a Power Macintosh computer. The emulator converts 680x0 instructions into PowerPC instructions and sends them to the PowerPC runtime environment. The emulator also maintains the emulated 680x0 environment (such as 680x0 registers).

This emulator uses the basic Motorola 68040 instruction set. However, it does not support instructions from the optional 68881 or 68882 floating-point coprocessor. Those applications which use the SANE math routines will be compatible with PowerPC systems and gain the benefit of the PowerPC's fast floating point unit.

A PowerPC implementation of System 7's Virtual Memory Manager is supported by the system. Applications that use the System 7 VM interface should work correctly, but those relying on directly accessing the 68K PMMU will break.

Note: The 680x0 emulator most resembles the Macintosh Centris 610. Applications or other software which runs on the Centris 610 will most likely run without problems under the emulator.

The emulator maintains tables which maps a 680x0 instruction to one or more PowerPC instructions. On average, one 680x0 instruction requires 10 PowerPC instructions. A PowerPC application will be slightly larger than its 680x0 counterpart because it generally takes more instructions to accomplish the same work on a RISC system than a CISC system.

Compatibility
-------------
The emulator has been designed to be highly compatible with those applications which adhere to the Macintosh programming guidelines. However, there are operational difference between the emulator and an actual 680x0 processor. The known exceptions are the following:

* No support for coprocessor's (FPU or MMU) instruction set (as mentioned
above)

* The emulator will runs as fast as the system will allow. There is no
attempt to maintain the same instruction timing as a 68040
microprocessor.

* The 68020 module calls, CALLM and RTM were deleted in subsequent 680x0
microprocessor. These calls are not supported by the emulator. Calling
them will result in an illegal instruction exception. This should not be
a problem for applications which run on 68030 or 68040 based systems.

* Within the 680x0 family, there are several instructions which have
reserved fields. Although unlikely to have been intentionally done,
accidental reliance on these fields may result in unexpected behavior
when run under the 68LC040 emulator.

* Address error exceptions are handled differently under the emulator. A
680x0 microprocessor checks for address errors before completing the
execution of a branch instruction. For performance reasons, the emulator
checks after executing the branch with PowerPC systems. This may cause
problems with applications which install an address error exception
handler.

* Bus error exceptions are also handled differently under the emulator.
Thus, applications with bus error handlers need to account for these
differences.

* It may be necessary to modify some memory-mapped I/O calls to perform
certain I/O accesses.

Note: For details on these compatibility issues refer to the Inside Macintosh: PowerPC System Software book. Available from Apple Programmer's Developers Association (APDA).

Article Change History:
14 April 1994 - Corrected a wording problem.
21 March 1994 - Made miscellaneous corrections.

Support Information Services


Published Date: Feb 19, 2012