is it possible to do that??? because I'm now looking to prove something like this scenario

I want to buy a laptop but the specs was not given or posted in the window of a certain computer shop??? and they let me test it... but how to assemble the codes for finding the real specs...

sometimes I thought that some computer selling in computer shops was just a fraud

Not just the processor only but other hardwares as well

Sounds like a class assignment to me. There are plenty of free downloads for little tools thate give full processor specifications, CPU speed,video card, etc.

If you're looking to do it yourself (like for a school project) if you are referring to an 80x86 then there's serveral CPU instructions one being CPUID that gets that informatin for you!
Actually there are several steps to follow. These are detailed in a book I have, "Vector Game Math Processors" by James Leiterman. It's out of print but is still available from Amazon, etc.

First step is flipping the ID#21 in the EFLAGS register to determine pre-post 80486. There are other status register with Feature bits and then you can execute the cpuid instruction. It too contains featue bits. Through sub-instructions you can retrieve manufacturer information, model information, etc.

Technically the only reason I can think of for writing something like this is if your program needs more specific information from the computer its running on so it can detect what drivers to utiliize based upon what features the processor has. However most processors manufactured the last few years is fully loaded and not much reason to pindown exact processor properties.

Sounds like a class assignment to me. There are plenty of free downloads for little tools thate give full processor specifications, CPU speed,video card, etc.

If you're looking to do it yourself (like for a school project) if you are referring to an 80x86 then there's serveral CPU instructions one being CPUID that gets that informatin for you!
Actually there are several steps to follow. These are detailed in a book I have, "Vector Game Math Processors" by James Leiterman. It's out of print but is still available from Amazon, etc.

First step is flipping the ID#21 in the EFLAGS register to determine pre-post 80486. There are other status register with Feature bits and then you can execute the cpuid instruction. It too contains featue bits. Through sub-instructions you can retrieve manufacturer information, model information, etc.

Technically the only reason I can think of for writing something like this is if your program needs more specific information from the computer its running on so it can detect what drivers to utiliize based upon what features the processor has. However most processors manufactured the last few years is fully loaded and not much reason to pindown exact processor properties.

It helps me a little bit but the last can question is??? How to display in assembly language about the information of proccesors and other Hardwares as well

Here's a snippet from the book I just mentioned!

All you had to do is go on-line, search for the book, and download sample code from its link! Or search for 8086 CPU detection.

.386P

        pushfd                          ; push EFLAGS register on stack
        pop     eax                     ; pop those flags into eax

        mov     ecx,eax                 ; save a copy of EFLAGS
        xor     eax,EFLAGS_AC           ; flip AC bit#18 in EFLAGS
        push    eax                     ; push modified flags on stack
        popfd                           ; pop those flags back into EFLAGS

        pushfd                          ; Now push resulting EFLAGS on stack
        pop     eax                     ; pop those flags into eax

        xor     eax,ecx                 ; If AC bit didn't flip...
        jz      $Is386                 ; then jump, as processor is an 80386

        .486P

        mov     eax,ecx                 ; get a copy of original EFLAGS
        xor     eax,EFLAGS_ID           ; flip ID bit#21 in EFLAGS
        push    eax                     ; push modified flags on stack
        popfd                           ; pop those flags back into EFLAGS

        pushfd                          ; Now push resulting EFLAGS on stack
        pop     eax                     ; pop those flags into eax

        xor     eax,ecx                 ; If ID bit didn't flip...
        jz      $Is486                 ; then jump, as processor is an 80486!

        push    ecx                     ; Push the original flags
        popfd                           ; Restore EFLAGS back to normal

        .586P
         xor    eax,eax                 ; setup for CPUID instruction
         cpuid                          ; Get  vendor ID
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.