Created
March 27, 2019 15:20
-
-
Save thata/f218e40d3d05a37e507b7712fc28091b to your computer and use it in GitHub Desktop.
MIPSの引数4つ以上の関数呼出し規約どうなってる?
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
goodbye: | |
.set nomips16 | |
.frame $fp,8,$31 # vars= 0, regs= 1/0, args= 0, gp= 0 | |
.mask 0x40000000,-4 | |
.fmask 0x00000000,0 | |
.set noreorder | |
.set nomacro | |
addiu $sp,$sp,-8 | |
sw $fp,4($sp) | |
move $fp,$sp | |
sw $4,8($fp) | |
sw $5,12($fp) | |
sw $6,16($fp) | |
sw $7,20($fp) | |
lw $3,8($fp) | |
lw $2,12($fp) | |
nop | |
addu $3,$3,$2 | |
lw $2,16($fp) | |
nop | |
addu $3,$3,$2 | |
lw $2,20($fp) | |
nop | |
addu $3,$3,$2 | |
lw $2,24($fp) | |
nop | |
addu $3,$3,$2 | |
lw $2,28($fp) | |
nop | |
addu $2,$3,$2 | |
move $sp,$fp | |
lw $fp,4($sp) | |
addiu $sp,$sp,8 | |
j $31 | |
nop |
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
main: | |
lw $28,24($fp) | |
li $2,5 # 0x5 | |
sw $2,16($sp) | |
li $2,6 # 0x6 | |
sw $2,20($sp) | |
li $4,1 # 0x1 | |
li $5,2 # 0x2 | |
li $6,3 # 0x3 | |
li $7,4 # 0x4 | |
lw $25,%call16(goodbye)($28) | |
nop | |
jalr $25 | |
nop | |
lw $28,24($fp) | |
move $2,$0 | |
move $sp,$fp | |
lw $31,36($sp) | |
lw $fp,32($sp) | |
addiu $sp,$sp,40 | |
j $31 | |
nop | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment