- 论坛徽章:
- 1
|
回复 12# daxiguagg
我的用C写的hello world程序汇编出来是这样子的。- .globl string
- .section .rodata
- .LC0:
- .string "hello world!\n"
- .data
- .align 8
- .type string, @object
- .size string, 8
- string:
- .quad .LC0
- .text
- .globl main
- .type main, @function
- main:
- .LFB0:
- .cfi_startproc
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset 6, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register 6
- subq $16, %rsp
- movl %edi, -4(%rbp)
- movq %rsi, -16(%rbp)
- movq string(%rip), %rax
- movq %rax, %rdi
- movl $0, %eax
- call printf
- movl $0, %eax
- leave
- .cfi_def_cfa 7, 8
- ret
- .cfi_endproc
- .LFE0:
- .size main, .-main
- .ident "GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-4)"
- .section .note.GNU-stack,"",@progbits
复制代码 |
|