.extern printf
.global main
.section .data
hello: .asciz "Hello World!\n"
.section .text
main:
movq $hello, %rdi
movq $0, %rax
call printf
movq $0, %rax
ret
编译:
cc print.s -o print
输出:
Hello World!
.extern printf
.global main
.section .data
hello: .asciz "Hello World!\n"
.section .text
main:
movq $hello, %rdi
movq $0, %rax
call printf
movq $0, %rax
ret
编译:
cc print.s -o print
输出:
Hello World!
转载于:https://my.oschina.net/tsh/blog/1457163