Re: Asm question (port from linux ppc)
Re: Asm question (port from linux ppc)
- Subject: Re: Asm question (port from linux ppc)
- From: email@hidden
- Date: 27 Nov 2004 16:45:19 -0000
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/index.html?http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/PPCInstructions/chapter_6_section_6.html
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden