问题
Let me preface this by saying that I'm new to MIPS.
I'm trying to reverse some sample code that I compiled for PSX using Psy-Q. I compiled a small "hello world" program that happens to contain the following function call in C
int main() {
FntLoad(960, 256) // load the font from the BIOS into the framebuffer
}
I suppose it doesn't matter too much what the function call is, but it is that line above with those two arguments.
My disassembly looks like the following for that function call in hexadecimal:
C0 03 04 24 E7 45 00 0C 00 01 05 24
In my disassembler, it looks like the following 3 instructions:
TEXT:800103E4 li $a0, 0x3C0
TEXT:800103E8 jal FntLoad
TEXT:800103EC li $a1, 0x100
Out of the examples that I've seen so far, all function arguments are loaded before the jal
line, but in my disassembly the load immediate happens after the jump.
Is this correct or is something weird going on here? If my understand of how jal
is incorrect, would someone mind explaining how the last argument is passed?
来源:https://stackoverflow.com/questions/53715539/why-does-this-load-instruction-come-after-a-jump