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

  • SEARCH
  • Home
  • 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 3338440
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:22:33+00:00 2026-05-18T00:22:33+00:00

I have a register ecx with value 0x01ABCDEF (hex value) I want to acces

  • 0

I have a register ecx with value 0x01ABCDEF (hex value)
I want to acces just BYTE 2 (AB) in order to perform operations on it.
I have tried using cl or ch but those do not acces the right byte.
I tried doing:

mov bh, [ecx+2]

but it just errors out…
Thank you in advanced for your time and help!

  • 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-05-18T00:22:33+00:00Added an answer on May 18, 2026 at 12:22 am

    Yes — CL will give you EF and CH will give you CD in the value you’ve given above. Since you don’t want those, you’ll have to do a shift to get the bytes in the right places:

    mov ebx, ecx
    shr ebx, 8
    

    Now BH will have AB, and BL will have CD.

    Edit: From your comment, you apparently don’t really need the value in BH — rather, you just want to manipulate that particular byte without affecting the rest of ECX. In that case, it’s probably easiest to do something like this:

    ror ecx, 16
    not cl    // placeholder for the manipulation
    rol ecx, 16
    

    This just rotates ECX so the byte we care about is in CL, then manipulates CL, then rotates ECX back so the bytes are where they started. I should add that while this is simple, on some processors it will be pretty slow. The Pentium IV didn’t have a barrel shifter, so rotates take time proportional to the number of bits you move by. Worse, manipulating CL followed by using ECX can (and in this case probably will) cause a Partial Register Stall. Whether this matters to you will depend on what you’re trying to accomplish with this, and whether it’ll be surrounded by other instructions that can be executed during the PRS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a web application where users can register and have a
I want to use FileSystemObject, but it lost in DCOMCNFG, I have register it
I have a register form in which i want when the user selects an
in my asp.net page i have register page. i want to create a xml
I want to make a little application. That will have register, save, update, delete,
I have a register model thats tighly bound to a register view. The register
I have a register page that saves the data to a database the only
I have a requirement where I have to register users first via email. So,
i've a login view presented as a ModelViewController and i have a register view
In iOS apps, we have to register nib files with our table view before

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.