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

@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@ha /* r3 = 0x0001oooo */ addi r3, r3, 0x0000FFFF@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@h /* r3 = 0x00000000 */ ori r3, r3, 0x0000FFFF@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@hotmail.com wrote:
In u-boot/cpu/mpc8xx/start.S,I usually find this symbol "@",such as followed:
_start: lis r3, CFG_IMMR@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@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@smiths-aerospace.com. Please update your address books! Please begin using the new form immediately. ***********************************************************************

Jerry Van Baren wrote:
@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@ha /* r3 = 0x0001oooo */ addi r3, r3, 0x0000FFFF@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@h /* r3 = 0x00000000 */ ori r3, r3, 0x0000FFFF@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
It's useful when the second instruction is a load, or a store.
Instead of doing this to store a value to the global variable foo:
lis r3,foo@h ori r3,r3,foo@l stw r4,0(r3) ; store r4 to foo
do this:
lis r3,foo@ha stw r4,foo@l(r3) ; store r4 to foo
that is because the store and load immediate offsets are sign extended.
Regards
Pantelis
At 11:32 AM 5/8/2003 -0400, okisoftxman@hotmail.com wrote:
In u-boot/cpu/mpc8xx/start.S,I usually find this symbol "@",such as followed:
_start: lis r3, CFG_IMMR@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@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@smiths-aerospace.com. Please update your address books! Please begin using the new form immediately.
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara The only event dedicated to issues related to Linux enterprise solutions www.enterpriselinuxforum.com
U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
participants (2)
-
Jerry Van Baren
-
Pantelis Antoniou