to get back into the MIPS assembler, I've compiled the plasma demo from the NDK, and dumped it via objdump, the entry function looks like this:
2514: 3c1c0001 lui gp,0x1
2518: 279c6aec addiu gp,gp,27372
251c: 0399e021 addu gp,gp,t9
2520: 27bdf320 addiu sp,sp,-3296
2524: afbf0cdc sw ra,3292(sp)
2528: afbc0010 sw gp,16(sp)
252c: afa40ce0 sw a0,3296(sp)
my confusion comes from line 2520, the stack(sp) is extended to 3296 bytes, in line 252c (shortly before calling app_dummy), a0 is stored to sp+3296. isn't that overwriting the parental stack area? should the caller allocate something? android_main doesn't actually return anything and only passes one pointer via a0. there are quite some ABI versions for mips, that I've found on the net, but none really gives any hint how this assembly could possibly work, yet I guess it works, as it's a sample that probably a lot of people tried.
I'd be happy about any explanation or link, thanks!
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.