#include
//label: for(i = 0; i < 10; i++) {s...
int main()
{
int sum=0, i;
for(i = 0; i < 10; i++)
{
sum+=i;
}
return sum;
}
| .file "14.c"
.text
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $16, %esp
movl $0, -12(%ebp)
movl $0, -8(%ebp)
jmp .L2
.L3:
movl -8(%ebp), %eax
addl %eax, -12(%ebp)
addl $1, -8(%ebp)
.L2:
cmpl $9, -8(%ebp)
jle .L3
movl -12(%ebp), %eax
addl $16, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (GNU) 4.1.2 20080704 ...
.section .note.GNU-stack,"",@progb...
| .file 1 "14.c"
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl main
.ent main
.type main, @function
main:
.frame $fp,24,$31 # vars= 8, regs...
.mask 0x40000000,-8
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set reorder
addiu $sp,$sp,-24
sw $fp,16($sp)
move $fp,$sp
sw $0,8($fp)
sw $0,12($fp)
$L2:
lw $2,12($fp)
slt $2,$2,10
beq $2,$0,$L3
lw $3,8($fp)
lw $2,12($fp)
addu $2,$3,$2
sw $2,8($fp)
lw $2,12($fp)
addiu $2,$2,1
sw $2,12($fp)
b $L2
$L3:
lw $2,8($fp)
move $sp,$fp
lw $fp,16($sp)
addiu $sp,$sp,24
j $31
.end main
.ident "GCC: (GNU) 3.4.5"
| .file "14.c"
.text
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
movl $45, %eax
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (GNU) 4.1.2 20080704 ...
.section .note.GNU-stack,"",@progb...
| .file 1 "14.c"
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl main
.ent main
.type main, @function
main:
.frame $sp,0,$31 # vars= 0, regs=...
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set reorder
move $4,$0
move $3,$0
addu $4,$4,$3
$L8:
addiu $3,$3,1
slt $2,$3,10
.set noreorder
.set nomacro
bne $2,$0,$L8
addu $4,$4,$3
.set macro
.set reorder
subu $4,$4,$3
.set noreorder
.set nomacro
j $31
move $2,$4
.set macro
.set reorder
.end main
.ident "GCC: (GNU) 3.4.5"
| .file "14.c"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
movl $45, %eax
pushl %ebp
movl %esp, %ebp
pushl %ecx
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (GNU) 4.1.2 20080704 ...
.section .note.GNU-stack,"",@progb...
| .file 1 "14.c"
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl main
.ent main
.type main, @function
main:
.frame $sp,0,$31 # vars= 0, regs=...
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
move $4,$0
move $3,$0
addu $4,$4,$3
$L11:
addiu $3,$3,1
slt $2,$3,10
bne $2,$0,$L11
addu $4,$4,$3
subu $4,$4,$3
j $31
move $2,$4
.set macro
.set reorder
.end main
.ident "GCC: (GNU) 3.4.5"
|