.section .data msg: .ascii "Hello Syscall!\n" .section .text .globl _start _start: # write(1, msg, 15) movq $1, %rax # 系统调用号 1 是 write movq $1, %rdi # 文件描述符 1 是 stdout movq $msg, %rsi # 字符串地址 movq $15, %rdx # 字符串长度 syscall # <--- 真正的系统调用在这里! # exit(0) movq $60, %rax # 系统调用号 60 是 exit xorq %rdi, %rdi # 退出码 0 syscall # <--- 再次触发系统调用