The MASM Forum

Specialised Projects => PowerBASIC => Extending PowerBASIC => Topic started by: hutch-- on February 14, 2022, 06:07:44 AM

Title: Three CPU functions with source as library
Post by: hutch-- on February 14, 2022, 06:07:44 AM
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