Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Three CPU functions with source as library

Started by hutch--, February 14, 2022, 06:07:44 AM

Previous topic - Next topic


Two of these functions are Intel CPUID based and necessarily in assembler, the CPU processor count is a normal API based module. The complete build process is in the .lib directory and in the makelib.bat file, you will need to change the line,

  set pbpath=\basic\bin10\

To the path of your own PowerBASIC bin directory.

    StdOut "Your CPU Brand is "+cpu_vendor()
    StdOut "Your CPU Model is "+cpu_id_string()
    StdOut "Your CPU has "+format$(cpu_count())+" processors available"

Output like this.

Your CPU Brand is GenuineIntel
Your CPU Model is Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
Your CPU has 12 processors available