[U-Boot-Users] what means this symbol "@"?

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Thu May 8 13:22:52 CEST 2003


@h  = high order 16 bits
@l  = low order 16 bits
@ha = high order 16 bits adjusted so that, when you add the sign-extended 
low order 16 bits, the value comes out to the right number

Example of @ha:
   lis  r3,     0x0000FFFF at ha    /* r3 = 0x0001oooo */
   addi r3, r3, 0x0000FFFF at l     /* r3 = 0x0001oooo + 0xffffFFFF = 
0x0000FFFF */

will actually load 0x00010000 into r3 in the first instruction because the 
second instruction (addi) sign-extends the 0x0000FFFF to become 
0xFFFFFFFF.  After the addi, r3 will have the proper value 0x0000FFFF.

ori does not sign extend the immediate value, so it does not have this 
quirk and therefore you would use @h and @l:
   lis r3,     0x0000FFFF at h      /* r3 = 0x00000000 */
   ori r3, r3, 0x0000FFFF at l      /* r3 = 0x0000oooo | 0xooooFFFF = 
0x0000FFFF */

I've never figured out why someone would want to use addi instead of ori in 
the second instruction of the load sequence.

gvb


At 11:32 AM 5/8/2003 -0400, okisoftxman at hotmail.com wrote:
>In u-boot/cpu/mpc8xx/start.S,I usually find this symbol "@",such as
>followed:
>
>_start:
>  lis r3, CFG_IMMR at h  /* position IMMR */
>  mtspr 638, r3
>  li r21, BOOTFLAG_COLD /* Normal Power-On: Boot from FLASH */
>  b boot_cold
>
>what does it means? Thank you!



**********************************************************************
This e-mail and any files transmitted with it may be confidential and
may be legally privileged or otherwise exempt from disclosure under
applicable law. This e-mail and its files are intended solely for
the individual or entity to whom they are addressed and their content
is the property of Smiths Aerospace.  If you are not the intended
recipient, please do not read, copy, use or disclose this communication.
If you have received this e-mail in error please notify the e-mail 
administrator at postmaster at smiths-aerospace.com and then delete this 
e-mail, its files and any copies.

This footnote also confirms that this e-mail message has been scanned
for the presence of known computer viruses.

Smiths addresses are changing!  The new addresses are of the form
firstname.lastname at smiths-aerospace.com.  Please update your address
books!  Please begin using the new form immediately.
***********************************************************************




More information about the U-Boot mailing list