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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:37:27+00:00 2026-05-29T10:37:27+00:00

This code below takes in an two digit number (let’s say 12) in ASCII

  • 0

This code below takes in an two digit number (let’s say 12) in ASCII and should return this number as the number 12. (NOT ASCII)

mov     $IBUFF, %eax    # IBUFF stores the ASCII number 12
movl    $NUMBER, %ecx   # NUMBER will i put the number 12 (NO ASCII)

movb    (%eax), %bl     # Moves the first byte (1) to %bl
subb    $48, %bl        # Decrease %bl so it is not longer a ASCII sign.
movb    %bl, (%ecx)     # Moves this byte into the first place in NUMBER

inc %eax                # Increase IBUFF so it points to the next integer 
inc %ecx                # Increase NUMBER so it points to the next empty space

movb    (%eax), %bl     # Same as above
subb    $48, %bl        # Same as above
movb    %bl, (%ecx)     # Same as above


mov NUMBER, %eax        # Move the number 12 from NUMBER to %eax (return register)

When i run this code the return value is 513, not 12. 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-05-29T10:37:28+00:00Added an answer on May 29, 2026 at 10:37 am

    You need to accumulate the result (possibly in a register) by multiplying it by 10, and then adding the new digit. Basic base 10 representation. What you’re doing ends up storing the resulting digits in base 256.

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

Sidebar

Related Questions

I have this code below. As you can see I am passing two variables
Hi I'm using this code below to let a user draw their signature on
This code takes timings for n invocations of two methods that both do nothing
This code below is for executing ls -l | wc -l. In the code,
This code below works in all web browsers except IE: <input type="text" name="passwordLogin" value="Password"
Basically this code below returns the right information, but I need to add the
i am using this code below to dynamically capture the name of the button
How can this code compile? The code below in the operator int CAN access
I have this javascript code below that uses jquery, it is suppoed to be
I ended up with this horrible code below, I can't get a better result

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.