我在运行以下汇编代码时遇到错误
#cpuid using C library Functions
.section .data
output:
.asciz "The Processor Vendor ID is '%s'\n"
.section .bss
.lcomm buffer, 12
.section .text
.globl main
main:
movq $0, %rax
cpuid
movq $buffer, %rdi
movq %rbx, (%rdi)
movq %rdx, (%rdi)
movq %rcx, (%rdi)
pushq $buffer
pushq $output
call printf
addq $8, %rsp
pushq $0
call exit
它在 C 库调用的部分遇到分段错误:调用 printf 它正在 x86_64 模式下运行。关于 c 库,我在编译 x64 代码时遗漏了什么?还是代码有问题
谢谢