Created
June 1, 2016 22:43
-
-
Save gitpraetorianlabs/f1761a41f5997f2bd6b95c52af82df71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=------------------------------= | |
| [0x4003f4] | | |
| (fcn) sym.pass_args_to_me 52 | // Disassembling the pass_args_to_me function | |
| addiu sp, sp, -8 | // Adjust stack address by 8 bytes (int = 4 bytes) | |
| sw fp, 4(sp) | // Save Frame pointer Address | |
| move fp, sp | // Move SP to FP (This is behavior is an indication that we're dealing with local variables) | |
| sw a0, 8(fp) | // Save int a into the frame pointer | |
| sw a1, 0xc(fp) | // Save int b into the frame pointer. | |
| lw v1, 8(fp) | // Load int a into $v1 | |
| lw v0, 0xc(fp) | // Load int b into $v0 | |
| addu v0, v1, v0 | // Add $v1 and $v0 and store the result into $v0 | |
| move sp, fp | // Copy the frame pointer address into the stack pointer register ($sp) | |
| lw fp, 4(sp) | // Restore previously saved frame pointer | |
| addiu sp, sp, 8 | // Restore stack offset (8 bytes) | |
| jr ra | // Jump to the address loaded into $ra ($ra will point to the mov sp,fp instruction in main JAL = PC + 8 into $ra) | |
| nop | | |
=------------------------------= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment