I can haz assembly!
Simple CPUID, I also experimented with a version using an extra buffer variable and printf
.
It may not be much to others but I'm learning!
; CPUID
section .data
buffer: db "CPU Vendor ID: XXXXXXXXXXXX", 10, 0
bufferlen: equ $ - buffer
section .text
global _start
_start:
mov eax, 0 ; "Get maximum supported standard level and vendor ID string"
CPUID ; Call CPUID
mov [buffer+15], ebx ; Move 4 bytes from ebx to buffer+15
mov [buffer+19], edx ; Move 4 bytes from edx to buffer+19
mov [buffer+23], ecx ; Move 4 bytes from ecx to buffer+23
mov eax, 4 ; write syscall
mov ebx, 1 ; stdout
mov ecx, buffer ; buffer
mov edx, bufferlen ; size of buffer
int 80h ; call kernel
_exit:
mov eax, 1 ; exit syscall
mov ebx, 0 ; Return 0
int 80h ; call kernel