You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
532 B
29 lines
532 B
16 years ago
|
.section .rodata
|
||
|
.align 4
|
||
|
.LC0:
|
||
|
.string "hello assembler world, %d arguments given\n"
|
||
|
.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 $20, %esp
|
||
|
movl (%ecx), %eax
|
||
|
movl %eax, 4(%esp)
|
||
|
movl $.LC0, (%esp)
|
||
|
call printf
|
||
|
movl $0, %eax
|
||
|
addl $20, %esp
|
||
|
popl %ecx
|
||
|
popl %ebp
|
||
|
leal -4(%ecx), %esp
|
||
|
ret
|
||
|
.size main, .-main
|
||
|
.ident "GCC: (GNU) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)"
|
||
|
.section .note.GNU-stack,"",@progbits
|