Load an MPC555 register using GNU C

"David Eicher" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
Hello list,

 

I'm still having trouble properly loading the address of a linker generated
symbol into a register (r1) in the 555. This is a GNU C environment. My code
so far looks like this:

 

                        UWord32 tmp;

 

                        tmp = &(__SP_INIT);

                        asm ("lis                       r1,%0" : : "g" ((tmp
>> 16) & 0xFFFF));   /* __SP_INIT is generated by linker */

                        asm ("ori                       r1, r1,%0" : : "g"
((tmp) & 0xFFFF));

 

I'm trying to load the "address of" __SP_INIT which is the top of the stack
into register GPR1 (or r1).  But this code doesn't get it done, I'm not sure
what I'm doing wrong. The seems to be some little sutle point I'm missing.

 

Thanks for any insight you might be able to offer,

 

Dave

 

 



[Non-text portions of this message have been removed]



-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.