Path: utzoo!attcan!uunet!husc6!mailrus!ames!amdahl!apple!dan
From: dan@Apple.COM (Dan Allen)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Bug in MPW C 2.0.2 (PEA instead of PUSH.L)
Keywords: mpw c bug
Message-ID: <12776@apple.Apple.COM>
Date: 24 Jun 88 17:33:35 GMT
References: <1988Jun22.112228.462@mntgfx.mentor.com>
Reply-To: dan@apple.apple.com.UUCP (Dan Allen)
Organization: Apple Computer Inc, Cupertino, CA
Lines: 28

In article <1988Jun22.112228.462@mntgfx.mentor.com> tomc@mntgfx.mentor.com (Tom Carstensen) writes:
>I could not get the MPW C compiler to produce the following
>assembly code:
>
>    PUSH.L    $09EE
>    _SetClip
>
>and I was using the C statement:
>
>    SetClip( (RgnHandle) 0x09ee );
> 
>it always produced:
>
>    PEA    $09EE
>    _SetClip
>    
>PEA is quite different the PUSH.L, if I'm not mistaken.  Is
>this a bug, or am I just being stupid.

This is another of the Greenhills C "Optimizations".  Notice that
pushing (or rather, moving in the 68xxx parlance) $09EE has the same end
result as Pushing the Effective Address $09EE.  It happens to be a
couple of cycles shorter... but the code becomes unreadable until you
know what it is doing.

Dan Allen
Software Explorer
Apple Computer