flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > Check Intel processor support .

Author
Thread Post new topic Reply to topic
catafest



Joined: 05 Aug 2010
Posts: 81
Check Intel processor support .
How to check with fasm if the Intel processor come with support for:
Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality ?

Thank you. Best regards.
Post 13 Sep 2017, 11:34
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15171
Location: GW170817
You can use the CPUID instruction to obtain the capabilities. It has many input values and output values. Too many to list here. The Wikipedia page might not be up to date so check the manuals give all the details about how to find the data.
Post 13 Sep 2017, 11:52
View user's profile Send private message Visit poster's website Reply with quote
catafest



Joined: 05 Aug 2010
Posts: 81
Thank's for link - I will follow the link.
Also I will come with a answer if I solve this issue.
Post 14 Sep 2017, 13:31
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
catafest



Joined: 05 Aug 2010
Posts: 81
I think I have found a solution based on some internet links:

Code:
format PE GUI 4.0
entry start 

include 'win32ax.inc' 

;---  http://x86.renejeschke.de/html/file_module_x86_id_45.html

section '.code' code readable executable 

    start

        ; INVOKE CPUID FUNCTION 0x00000000 

        xor     eax,eax 
        cpuid 

        ; EXTRACT VENDOR STRING FROM

        mov     [out_buffer.vendor_ebx],ebx
        mov     [out_buffer.vendor_edx],edx
        mov     [out_buffer.vendor_ecx],ecx

        ; CHECK FOR FUNCTION 0x00000001 

        cmp     eax,0x00000001 
        jl      .NoCPUID_FN1 

        ; INVOKE CPUID FUNCTION 0x00000001 

        mov     eax,0x00000001 
        cpuid 
        ; TEST FOR HTT  Hyper-Threading Technology

        test    edx,00010000000000000000000000000000b
        jz      .NoHTT
        mov     [out_buffer.htt_arch4],'YES '
    .NoHTT:

        ; TEST FOR MMX

        test    edx,00000000100000000000000000000000b 
        jz      .NoMMX 
        mov     [out_buffer.mmx_ach4],'YES '
    .NoMMX

        ; TEST FOR SSE 

        test    edx,00000010000000000000000000000000b 
        jz      .NoSSE 
        mov     [out_buffer.sse_ach4],'YES '
    .NoSSE

        ; TEST FOR SSE2 

        test    edx,00000100000000000000000000000000b 
        jz      .NoSSE2 
        mov     [out_buffer.sse2_ach4],'YES '
    .NoSSE2

        ; TEST FOR SSE3 

        test    ecx,00000000000000000000000000000001b 
        jz      .NoSSE3 
        mov     [out_buffer.sse3_ach4],'YES '
    .NoSSE3

    .NoCPUID_FN1

        ; DISPLAY RESULTS AND QUIT 

        invoke  MessageBox,NULL,out_buffer,'CPUID',MB_OK+MB_ICONINFORMATION
        invoke  ExitProcess,0 
        jmp     $ 

;---  SECTION DATA STRUCTURE FOR MESSAGE BOX

section '.data' data readable writeable 

    out_buffer:
                        db 'VENDOR',2,9,'- '
      .vendor_ebx       dd 0 
      .vendor_edx       dd 0 
      .vendor_ecx       dd 0 
                        db 9,13,10

                        db 'NoHTT',2,9,'- '
      .htt_arch4        dd 'NO  '
                        db 9,10

                        db 'MMX',2,9,'- '
      .mmx_ach4         dd 'NO  ' 
                        db 9,10

                        db 'SSE',2,9,'- '
      .sse_ach4         dd 'NO  ' 
                        db 9,10

                        db 'SSE2',2,9,'- '
      .sse2_ach4        dd 'NO  ' 
                        db 9,10

                        db 'SSE3',2,9,'- '
      .sse3_ach4        dd 'NO  ' 
                        db 9,10

                        db 0 ; end out_buffer

;---  DEFAULT DATA INCLUDES

section '.idata' import data readable 

    library kernel32,'kernel32.dll',\ 
            user32,'user32.dll' 

    include 'api\kernel32.inc' 
    include 'api\user32.inc' 



http://www.felixcloutier.com/x86/CPUID.html
https://software.intel.com/sites/default/files/article/405250/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family.pdf
http://x86.renejeschke.de/html/file_module_x86_id_45.html
https://imgur.com/INd74Hk
Post 14 Sep 2017, 20:53
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.