lotus



previous page: 10.4) Why does my application work on an SE with accellerator (or a Mac II or Quadra), but not on one without? (Compatibility - Mac Programming)
  
page up: Mac Programming FAQ
  
next page: 10.6) Why does my application work on my Quadra but not on my accellerated SE? (Compatibility - Mac Programming)

10.5) Why does my application work on a IIci and a pre-1995 PowerMac but not on a Quadra? (Compatibility - Mac Programming)




Description

This article is from the Mac Programming FAQ, by Jon Watte h+@austin.metrowerks.com with numerous contributions by others.

10.5) Why does my application work on a IIci and a pre-1995 PowerMac but not on a Quadra? (Compatibility - Mac Programming)

Two reasons:

1) The Quadras 900 and 950 have special processors that handle the serial
ports; if you write directly to the serial chips, you will crash (this
goes for the IIfx as well)

2) The Quadras have 68040 processors, as have the Centrises. These
processors have separate instruction and data caches (like the 68030) but
they are larger (4K each) and unlike the 68030 which is write-through
data cached, the 68040 is copy-back data cached. This means that changes
you make to "your code" aren't really changed all the time, since the
changes may still be in the data cache and not written to memory when the
CPU reads that part of memory into its I-cache. Even worse; that part
might already have been read into the I-cache before you change it in the
D-cache, meaning that writing out the D-cache will still not be enough.
You need to flush both the caches when writing self-modifying code.

Self-modifying code includes code that builds its own jump tables and
code that decrypts itself and code that "stubs" MDEFs or WDEFs to jump
back into the application code.

You flush the cache using FlushDataCache() which is implemented if
Gestalt says you have a 68020 or better processor (or if the _HwDispatch
trap is implemented)

The current PowerMac 68k emulator doesn't have the self-modifying cache
problem, but a future faster version will.

 

Continue to:















TOP
previous page: 10.4) Why does my application work on an SE with accellerator (or a Mac II or Quadra), but not on one without? (Compatibility - Mac Programming)
  
page up: Mac Programming FAQ
  
next page: 10.6) Why does my application work on my Quadra but not on my accellerated SE? (Compatibility - Mac Programming)