Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8816041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:31:27+00:00 2026-06-14T04:31:27+00:00

Quite simple, really. I tried to use EAX[31:26] in my code, and was presented

  • 0

Quite simple, really. I tried to use EAX[31:26] in my code, and was presented with the following error:

error C2400: inline assembler syntax error in 'second operand'; found ':'

And here’s my code:

unsigned _EAX, _EBX, _ECX, _EDX ;
//LoadCPUID(EAX_CACHECONFIG, _EAX, _EBX, _ECX, _EDX);

__asm {
    mov EAX, EAX_CACHECONFIG ;
    mov ECX, 0x00000001 ;
    cpuid ;
    mov _EAX, EAX[31:26] ;
}

return _EAX;

Is it possible to select bits in the way shown above in MSVC’s inline assembler? Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:31:29+00:00Added an answer on June 14, 2026 at 4:31 am

    Assuming you’re using 0-based bit numbers with 0 being the least significant bit, you can get those top six bits simply by right-shifting eax 26 bits.

    That gives you the upper six bits in the lower bit positions. If you want the result in the same bit positions, simply and it with 0xfc000000.

    If I’ve misunderstood your bit positions, you can still use shifts and the bitwise operators to get what you want, though the values (that you want to and with or shift by) may differ.

    Based on your comment:

    After executing the CPUID instruction, (EAX[31:26] + 1) contains the number of cores.

    The way you would get the number of cores is as follows:

    ...                  ; load up cpuid registers first
    cpuid
    shr    eax, 26       ; move bits 31:26 down to 5:0
    inc    eax
    ...                  ; eax now contains the core count (1 thru 64).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am stuck with something quite simple but really annoying: I have an xml
I am having some trouble with really quite simple collision detection. Here is my
This is probably a really simple question but one I've never quite worked out
This is probably something really simple, however I am quite new to PHP, and
This should be quite simple, but I can't work out the syntax. I have
It's quite simple, I don't understand why the following does match: preg_match('/\<td valign=top class=bericht\>(.*\s)*<\/td>/',$html,$matches3);
The problem is probably quite simple. $q = SELECT id FROM users WHERE name
My question is quite simple.. I need to convert an Element object into an
My schema is quite simple- Each user has an id and name. There are
My question is quite simple. Is it possible to inactivate all toasts of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.