* HI and LO qualifiers in MIPS assembly
@ 2006-03-10 16:07 Nikolaos Kavvadias
2006-03-10 16:46 ` Thiemo Seufer
0 siblings, 1 reply; 2+ messages in thread
From: Nikolaos Kavvadias @ 2006-03-10 16:07 UTC (permalink / raw)
To: binutils
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there
i have a question on some alternative syntaxes of the MIPS
instructions regarding the %hi and
%lo qualifiers. The %hi is necessary when specifying addition of a
carry from the lower part
highest bit.
Sometimes gas emits what i believe is a macro-instruction, e.g. this
one is for the LUI:
lui $reg, %hi(symbol)
e.g.
lui $10,%hi(sym)
another one is:
lw $2, %lo(v)($10)
How can I expand these expressions into "normal" instructions, as
these are defined in the MIPS32 architecture manual for programmers
(vol. 2)?
I mean how does the macro-expansion take place?
thanks in advance
Nikolaos Kavvadias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEEaRJMPiy0tCWlz4RAtQqAJ9VIpdiYPO8CFq0hAyS5BWBXfaXhACeLleD
ghNQXICGtiASo859Yt6TM48=
=yObe
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: HI and LO qualifiers in MIPS assembly
2006-03-10 16:07 HI and LO qualifiers in MIPS assembly Nikolaos Kavvadias
@ 2006-03-10 16:46 ` Thiemo Seufer
0 siblings, 0 replies; 2+ messages in thread
From: Thiemo Seufer @ 2006-03-10 16:46 UTC (permalink / raw)
To: Nikolaos Kavvadias; +Cc: binutils
On Fri, Mar 10, 2006 at 06:07:37PM +0200, Nikolaos Kavvadias wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi there
>
> i have a question on some alternative syntaxes of the MIPS
> instructions regarding the %hi and
> %lo qualifiers. The %hi is necessary when specifying addition of a
> carry from the lower part
> highest bit.
>
> Sometimes gas emits what i believe is a macro-instruction, e.g. this
> one is for the LUI:
I assume you mean "gcc emits ..."
> lui $reg, %hi(symbol)
> e.g.
> lui $10,%hi(sym)
>
> another one is:
> lw $2, %lo(v)($10)
Those aren't macros (or, pedantically speaking, macros which just
expand to single instructions with the same mnemnonic). The %hi
and %lo tell gas/ld to encode the appropriate part of the symbol
value in the associated relocation.
> How can I expand these expressions into "normal" instructions, as
> these are defined in the MIPS32 architecture manual for programmers
> (vol. 2)?
lui and lw are MIPS32 instructions. There is also a lw macro in gas
which may expand into multiple instruction for e.g.
lw $1, sym($4)
With a percent op, you get a direct mapping to a relocation.
Thiemo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-10 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-10 16:07 HI and LO qualifiers in MIPS assembly Nikolaos Kavvadias
2006-03-10 16:46 ` Thiemo Seufer
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 read-only IMAP folder(s) and NNTP newsgroup(s).