GithubHelp home page GithubHelp logo

danieldotwav / cpu-manufacturer-id-decoder Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 10 KB

This program utilizes C++ and specific Windows compiler intrinsics to decode and display the CPU manufacturer ID by accessing the CPU's built-in CPUID information. It demonstrates how to extract and format this low-level information for display.

C++ 100.00%
cpp cpuid intrinsics system-information windows-programming hardware-identification

cpu-manufacturer-id-decoder's Introduction

CPU Manufacturer ID Decoder

This program is designed to decode and print the CPU manufacturer ID using C++. It utilizes the intrinsic function __cpuid provided by <intrin.h> to access the CPU's manufacturer ID and then prints it to the standard output.

Requirements

  • A compiler that supports C++ and the <intrin.h> header file. This typically means using a compiler on Windows, as <intrin.h> is specific to Microsoft's compilers (e.g., MSVC).

How It Works

The program defines a function decodeAndPrintCpuManufacturer which performs the following operations:

  1. It declares an integer array cpuInfo with 4 elements to store the CPUID information.
  2. A character array manufacturerId of 13 bytes is declared to hold the 12-character manufacturer ID plus a null terminator.
  3. The __cpuid function is called with cpuInfo array and an input value of 0 to retrieve the CPU manufacturer ID.
  4. The CPU manufacturer ID is extracted from the cpuInfo array (from the EBX, EDX, and ECX registers) and stored in the manufacturerId array in the correct order.
  5. The manufacturer ID is null-terminated and printed to the standard output.

Output

CPU Manufacturer ID: [Manufacturer ID]

Where [Manufacturer ID] is replaced with the actual ID retrieved from the CPU.

cpu-manufacturer-id-decoder's People

Contributors

danieldotwav avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.