Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Codewarrior Embedded > MPC555 assemble...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 369 of 413
Post > Topic >>

MPC555 assembler label issues

by "Chris P" <cpiastri@[EMAIL PROTECTED] > Jan 10, 2006 at 11:23 PM

Hi,

I just downloaded the eval version of MPC5xx 8.1 from Metrowerks. I'm
having the simplest problem that i just can't find the answer to in the
docs.

I'm trying to work in native assembler and generate a flat binary,
which is kinda working out but the problem i have is with the assembler
not assigning label addresses into my code.

eg.

..text
..org 0x10000

start:

	li	r28, 0

	lis	r26, myvar@[EMAIL PROTECTED]
 r26, myvar@[EMAIL PROTECTED]
 0(r26)

	lis	r26, 0x10050@[EMAIL PROTECTED]
 r26, 0x10050@[EMAIL PROTECTED]
 0(r26)

	blr


myvar:      .long 0x0

the listing file it generates doesn't have the address for the label in
it (nor does the .elf file the linker produces), as you can see on the
2nd and 3rd lines of code here. However if i explicitly define the
address it works, as you can see on lines 5 & 6. What beats me is that
if i remove the @[EMAIL PROTECTED]
 and @[EMAIL PROTECTED]
 after the label name, the compiler generates
an error with the exact label address (obviously saying it can't load
the 32 bit address). Anyone got any ideas? I'd like to get it sorted
before i fork out the $$$ for the full licensed version.

Chris...


                      .text
                      .org         0x10000
                       start

0x00010000: 3b800000    li   r28, 0
0x00010004: 3f400000    r26, myvar@[EMAIL PROTECTED]
 635a0000    ori  r26, r26, myvar@[EMAIL PROTECTED]
 939a0000    stw  r28, 0(r26)
0x00010010: 3f400001    lis  r26, 0x10050@[EMAIL PROTECTED]
 635a0050    r26, r26, 0x10050@[EMAIL PROTECTED]
 939a0000    stw  r28, 0(r26)
0x0001001c: 4e800020    blr

0x00010020: 00000000    myvar .long  0x0
 




 2 Posts in Topic:
MPC555 assembler label issues
"Chris P" <c  2006-01-10 23:23:12 
Re: MPC555 assembler label issues
bastian42@[EMAIL PROTECTE  2006-01-25 11:55:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 16:21:50 CDT 2008.