作者在 2010-12-30 19:35:23 发布以下内容
.data
output:
.asciz "This is section %d\n"
.text
.global _start
_start:
pushl $1
pushl $output
call printf
add $8, %esp
call overhere
pushl $3
pushl $output
call printf
add $8, %esp
pushl $0
call exit
overhere:
pushl %ebp
movl %esp, %ebp
pushl $2
pushl $output
call printf
add $8, %esp
movl %ebp, %esp
popl %ebp
ret
output:
.asciz "This is section %d\n"
.text
.global _start
_start:
pushl $1
pushl $output
call printf
add $8, %esp
call overhere
pushl $3
pushl $output
call printf
add $8, %esp
pushl $0
call exit
overhere:
pushl %ebp
movl %esp, %ebp
pushl $2
pushl $output
call printf
add $8, %esp
movl %ebp, %esp
popl %ebp
ret