.section .data
output:
.asciz "the value is '%s'\n"
.section .bss
.lcomm buffer,12
.section .text
.globl _start
_start:
nop
movl $0,%eax
cpuid
movl $buffer,%edi
movl %ebx,(%edi)
movl %edx,4(%edi)
movl %ecx,8(%edi)
movl $buffer,%esi
movl $output,%edi
movl $0,%eax
call printf
movl $0,%eax
call exit
output:
.asciz “The processor Vendor ID is ‘%s’\n”
Notice that this uses the .asciz directive instead of .ascii.
The printf function expects a null terminated string as the output string.