Description
This article is from the Mac Programming
FAQ, by Jon Watte h+@austin.metrowerks.com with numerous
contributions by others.
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)
Assuming you're not calling Color QuickDraw (which is not
available on accellerated SEs), you most probably have an
odd-aligned word access somewhere.
The 68000 does not allow words or longwords to be read from odd
addresses, while the 68020 and up relaxes this restriction (it
still is slower than aligned-word access though)
This may or may not crash depending on your compiler:
*code*
struct foo {
char c1 ;
char c2 ;
char c3 ;
char c4 ;
char c5 ;
} bar ;
long * x = ( long * ) & bar . c2 ;
* x = 0x12345678 ; /* X is odd if compiler doesn't pad */
This WILL crash on an SE/Plus/Classic/PB100:
char foo [ 10 ] ;
long * x = ( long * ) & foo [ 1 ] ;
* x = 0x12345678 ;
*end*
 
Continue to:
Share and Enjoy
Bookmark this story so others can enjoy it:
Tags
os, Mac, macintosh, apple, programming, software