public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pantelis Antoniou <panto@intracom.gr>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] what means this symbol "@"?
Date: Thu, 08 May 2003 15:26:24 +0300	[thread overview]
Message-ID: <3EBA4CF0.4010101@intracom.gr> (raw)
In-Reply-To: <5.1.0.14.2.20030508070642.02646ac0@falcon.si.com>

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 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 

  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 at h
   ori  r3,r3,foo at l
   stw  r4,0(r3)       ; store r4 to foo

do this:
  
   lis  r3,foo at ha
   stw  r4,foo at 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 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.
> ***********************************************************************
>
>
> -------------------------------------------------------
> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>

  reply	other threads:[~2003-05-08 12:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00039882.C22236@hotmail.com>
2003-05-08 11:22 ` [U-Boot-Users] what means this symbol "@"? Jerry Van Baren
2003-05-08 12:26   ` Pantelis Antoniou [this message]
2003-05-08  2:32 seaman
2003-05-08  4:24 ` Erik Christiansen
     [not found] ` <3EBA0A5A.4080203@bigfoot.com>
2003-05-08  7:09   ` seaman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EBA4CF0.4010101@intracom.gr \
    --to=panto@intracom.gr \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox