Path: utzoo!attcan!uunet!husc6!mailrus!ames!amdahl!apple!wrs
From: wrs@Apple.COM (Walter Smith)
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: <12786@apple.Apple.COM>
Date: 24 Jun 88 19:20:10 GMT
References: <1988Jun22.112228.462@mntgfx.mentor.com> <12776@apple.Apple.COM>
Reply-To: wrs@apple.apple.com.UUCP (Walter Smith)
Organization: Apple Computer Inc, Cupertino, CA
Lines: 41

I thought this was stabilized, but people are still confused, so let's
get this straight once and for all.

	MOVE.L	$09EE, -(SP)

puts the contents of location $09EE on the stack.

	MOVE.L	#$09EE, -(SP)

puts the number $09EE on the stack.

	PEA	$09EE

also puts the number $09EE on the stack.

	SetClip( (RgnHandle) 0x09ee );

passes the number 0x09ee as a RgnHandle to SetClip, thus generating

	MOVE.L	#$09EE, -(SP)	or	PEA	$09EE
	_SetClip

The correct C code,

	SetClip( *(RgnHandle *)0x09ee );

dereferences the RgnHandle pointer 0x09ee and passes the contents to
SetClip, thus generating

	MOVE.L	$09EE, -(SP)
	_SetClip

I hope this will take care of the confusion.

- Walt
--
Walter Smith		Apple Computer			wrs@apple.com
			Special Projects		(408) 973-4015
Disclaimer:
Anyone who thinks I might be representing Apple Computer, Inc. in any
official capacity on Usenet, of all places, has a serious attitude problem.