Originally posted by Joe This looks interesting.
It uses GCC, the compiler that produces such genius as:
0xA40010F4 ADDIU $t5, $t5, 0x0000 And:
0xA40010D8 LUI $t5, 0xA410
0xA40010DC LW $t7, 0x0C($t5)
0xA40010E0 ADDIU $t5, $t5, 0x000C
0xA40010E4 ANDI $t7, $t7, 0x0020
0xA40010E8 BNEL $t7, $r0, 0xA40010DC
0xA40010EC LUI $t5, 0xA410 Now, GCC isn't all bad. It did optimize a lot of register access for pipelined execution.
Where in the world is that code from? Late '90s? If that's the case, then I am not at all surprised. Look at Mario 64's disassembly and you'll see that the MIPS code generation for GCC back then was atrocious, but that is no longer the case. By the way, always use ".set noreorder" in your source when you're writing assembly for the GNU assembler; but you probably already knew that.
Another thing that may put you off is if you see something like this (in disassembled output):
lui $t7,0x8040
addiu $t7,$t7,0x0000
There is no way around this. GCC doesn't know that the address it's going to be referring to in the linked output only needs a 'lui' instruction. It always generates a lui/ori pair and a corresponding pair of HI16 and LO16 relocations:
lui $t7,%hi(whatever)
addiu $t7,$t7,%lo(whatever)
All this GCC bickering is irrelevant anyway, since I'm assuming most assembly hackers use, well, assembly.
Originally posted by Joe
The disassembler (the only part I'm interested in) crashed when I scrolled too far down. I ought to file a bug report.
Could you give me a little information about the file?
Originally posted by Joe Also, the N64 is MIPS R4000 based, not R3000.
Yes, I am aware, but ORIGINALLY I set out to integrate a sort of assembly tracer for MIPS binaries conforming to the o32 ABI (which is for the MIPS R3000 processor), and as you may know, all N64 games use this ABI.
Thank you kindly for your input.
|