linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* What does instruction LA mean?
@ 2001-03-28  5:32 Jones Madhuri
  2001-03-28  6:19 ` Dan Malek
  2001-03-29  4:06 ` Srinivas Rao.M
  0 siblings, 2 replies; 3+ messages in thread
From: Jones Madhuri @ 2001-03-28  5:32 UTC (permalink / raw)
  To: linuxppc-embedded


Hello,

I am novice in Power PC assembly code and I am trying
compile in following code (written by someone else)
into head_8xx.S.

This function has instruction like

mfspr r3, IC_CST
LA r4, IC_CST_LEN

However the hardhat assembler doesn't understand the
mnemonic LA, is LA same as add immediate instruction?
addi r4, r4, IC_CST_LEN

Please help!!

Thanks.

M.J.

Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What does instruction LA mean?
  2001-03-28  5:32 What does instruction LA mean? Jones Madhuri
@ 2001-03-28  6:19 ` Dan Malek
  2001-03-29  4:06 ` Srinivas Rao.M
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Malek @ 2001-03-28  6:19 UTC (permalink / raw)
  To: Jones Madhuri; +Cc: linuxppc-embedded


Jones Madhuri wrote:

> I am novice in Power PC assembly code and I am trying
> compile in following code (written by someone else)
> into head_8xx.S.

Novice or otherwise, you shouldn't be placing any code in
head_8xx.S.  It's a guarantee you won't get Linux to boot.


> mfspr r3, IC_CST
> LA r4, IC_CST_LEN
>
> However the hardhat assembler doesn't understand the
> mnemonic LA,

Because there is no such instruction.  It looks like a
macro that will result in the two instruction pair:
	lis	r4, IC_CST_LEN@h
	ori	r4, r4, IC_CST_LEN@l

You shouldn't be messing around with those cache
management registers......


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What does instruction LA mean?
  2001-03-28  5:32 What does instruction LA mean? Jones Madhuri
  2001-03-28  6:19 ` Dan Malek
@ 2001-03-29  4:06 ` Srinivas Rao.M
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Rao.M @ 2001-03-29  4:06 UTC (permalink / raw)
  To: Jones Madhuri; +Cc: linuxppc-embedded


hi madhuri,
 	The LA here is a macro. I am not sure about the linux. but in the
pSOS+ i have seen a macro written in assembly language, which does the
'loading of address to a register' job.

Just check the assembly source files, you may find macro something like this.

  .macro    LA reg,symbol
  lis       reg,%hiadj(symbol)
  addi      reg,reg,%lo(symbol)
  .endm


such macros are written to load the value(constant) in to a register.

cheers,
srini...


On Tue, 27 Mar 2001, Jones Madhuri wrote:

>
> Hello,
>
> I am novice in Power PC assembly code and I am trying
> compile in following code (written by someone else)
> into head_8xx.S.
>
> This function has instruction like
>
> mfspr r3, IC_CST
> LA r4, IC_CST_LEN
>
> However the hardhat assembler doesn't understand the
> mnemonic LA, is LA same as add immediate instruction?
> addi r4, r4, IC_CST_LEN
>
> Please help!!
>
> Thanks.
>
> M.J.
>
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/?.refer=text
>
>

--

We are responsible for what we are, and whatever we wish ourselves to be, we
have the power to make ourselves. If what we are now has been the result of
our own past actions, it certainly follows that whatever we wish to be in
future can be produced by our present actions; so we have to know how to act.
-Swami Vivekananda


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-29  4:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-28  5:32 What does instruction LA mean? Jones Madhuri
2001-03-28  6:19 ` Dan Malek
2001-03-29  4:06 ` Srinivas Rao.M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).