%macro scall 4 ;macro with 4 parameters
mov rax, %1
mov rdi, %2
mov rsi, %3
mov rdx, %4
syscall
%endmacro
section .data
m1 db 10d,"The Vendor ID string is: "
l1 equ $-m1
m2 db 10d,"Register contents: "
l2 equ $-m2
newline db 10
section .bss
string resw 16
value resb 32
temp resd 1
temp1 resb 2
section .text
global _start
_start:
scall 1,1,m1,l1
mov eax,0h
cpuid
mov edi,string
mov [edi],ebx
mov [edi + 4],edx
mov [edi + 8],ecx
scall 1,1,string,12
scall 1,1,newline,1
scall 1,1,m2,l2
mov eax,01h
cpuid
mov [temp], eax
call hex2ascii
scall 1,1,value, 32
scall 1,1,newline,1
exit:
scall 60,0,0,0
hex2ascii:
mov esi, value
mov cl, 32
jmp1:
mov eax, [temp]
rol eax, 1
mov [temp], eax
and eax, 01h
add al, 30h
mov [esi], al
inc esi
dec cl
jnz jmp1
ret
To embed this project on your website, copy the following code and paste it into your website's HTML: