site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com Thanks Jonas. That first example did the trick. I found something similar about the same time in a tutorial at: http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/... I didn't know about the need for r1 to change atomically so that was really useful too for fixing the linux code. Regards, Bob Jonas Maebe wrote:
What the correct code on Darwin is depends. If newstackptr is simply a global variable in another object file and you're compiling without PIC, then you can use code like this:
--- .text
.globl _setstack _setstack: lis r3,ha16(_newstackptr) lwz r1,lo16(_newstackptr)(r3) blr ---
(note that r1 must always be valid and thus mist always changed using a single instruction under any PPC ABI I know of; your original linux code is wrong in that respect)
. .
In general, check the output of "gcc -S somefile.c" to see how things are done under Darwin/Mac OS X.
Jonas
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com