lotus



previous page: 10.3) I have to support System 6, don't I? (Compatibility - Mac Programming)
  
page up: Mac Programming FAQ
  
next page: 10.5) Why does my application work on a IIci and a pre-1995 PowerMac but not on a Quadra? (Compatibility - Mac Programming)

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)




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:















TOP
previous page: 10.3) I have to support System 6, don't I? (Compatibility - Mac Programming)
  
page up: Mac Programming FAQ
  
next page: 10.5) Why does my application work on a IIci and a pre-1995 PowerMac but not on a Quadra? (Compatibility - Mac Programming)