%hi() operator on MIPS
Shinpei Kato
shinpei@rt.k2.keio.ac.jp
Sat Aug 21 14:31:00 GMT 2004
Hi, there.
I found a strange behavior of GAS for MIPS.
If we assemble the following codes with -d option, we want to expect the following output. But the actual output is like below.
[code]
lui $8, %hi(0x87f0c000)
ori $8, $8, %lo(0x87f0c000)
[expected output]
lui t0, 0x87f0
ori t0, 0xc000
[actual output]
lui t0, 0x87f1
ori t0, 0xc000
Why 0x87f0 is changed to 0x87f1?
If we use la instead of lui/ori/%hi/%lo, it's expanded as follows and works.
[code]
la $8, 0x87f0c000
[output]
lui t0, 0x87f0
ori t0, t0, 0xc000
A similar problem was discussed before in this ML though, is this behavior OK?
Thanks,
Shinpei Kato <shinpei@rt.k2.keio.ac.jp>
More information about the Binutils
mailing list