(Assembly) CPUID by __Thanat0s__

Created the Monday 16 January 2023. Updated 2 weeks, 2 days ago.

Description:

This assembly code is using the CPUID instruction to check if the current processor is an Intel CPU. It moves the value 0 into the EAX register and then executes the CPUID instruction. It compares the value in the EDX register with a specific hexadecimal value to determine if the processor is an Intel CPU. If the comparison is true, it jumps to a specific label, otherwise, it exits the function. The preprocessor directive %ifdef NOSB_INTELONLY check if the symbol NOSB_INTELONLY is defined before the compilation, if it is defined, the code block following this directive will be included in the final executable.

Code

            %ifdef NOSB_INTELONLY
mov eax,0
cpuid
cmp edx,0x49656E69
je _isintel
ret
_isintel:
%endif