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 9006517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:25:57+00:00 2026-06-16T01:25:57+00:00

Given a 32 bit decimal number in %ecx and %edx , when trying to

  • 0

Given a 32 bit decimal number in %ecx and %edx, when trying to shift left and right each copy of the original number using shl and shr then moving the carry (the bit that was just cut) to a 8 bit register ah and al to compare if equal, I wrote:

movl    $32, %esi   #counter
xor     %eax, %eax
.LOOP:
shl     %ecx
setb    %ah
shr     %edx
setb    %al
cmp     %ah, %al
jnz     .np
decl    %esi
jnz     .LOOP

What am I doing wrong?

  • 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-16T01:25:58+00:00Added an answer on June 16, 2026 at 1:25 am

    You are comparing 2 numbers from opposite sides. Your program continues looping while ecx[i] == edx[32-i]. So what you’re actually doing is checking whether ecx contains an inverted value (i.e. with reordered bits) of edx. E.g., it will return true for ecx with value 0x200000 and edx with value 0x400.

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

Sidebar

Related Questions

Possible Duplicate: Default Number of Decimal Places to Output in PHP basically a bit
1) I understand that when you're converting binary to decimal the left most bit
So given I have a 64 bit machine. I know that the memory of
I need to enable cr4 bit 8 (PCE) on all cores of a given
This feature worked a bit, then stopped working. Background: Given a user is logged
I know this is a bit bleeding edge, but here's the question anyway: Given
I have the following bit of code, I expect that given cstdio is included
In Python, I can run a bit of code optionally if a given package
How to exchange bits of given integer number {p, p+1, ..., p+k-1} with {q,
I'm trying to convert a 128-bit unsigned integer stored as an array of 4

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.