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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:11:47+00:00 2026-06-15T05:11:47+00:00

I programmed a lot in java and know the basics of python and sometimes

  • 0

I programmed a lot in java and know the basics of python and sometimes I play with c++…
And those are all High Level Programming Languages and they’re great and all but I was curious about how things worked at a deeper level in this case assembly language… I started to learn assembly for the x86 processor and chose NASM as my assembler.
I spent some time learning how registers and the stack work, how the information is stored and how the information can be changed , not just reading but practicing, using a debugger, etc and something really started to bother me:
NUMERICAL OPERATIONS…

What I mean is whenever something is read from input it is stored as the correspondent ASCII value on the memory and I’m ok with it… I understand the basics of how to read and write to console with the whole pass offset and length system however as I mentioned before the characters including numbers are stored as ASCII values.. 0 is stored as 0x30, 1 as 0x31, etc… That means a single digit is stored as a whole byte and I see that as a disadvantage because I know a byte can represent numbers up to 255 which would save a lot of memory and time to do math operations and leave space for other data… In languages like c++ an integer value is represented by only 4 bytes which means those languages can store integers up to 4294967295

Getting to the point…
What I really want to know is what is the best approach to represent numbers and do basic arithmetic operations using nasm.. should I leave those numbers as ASCII values and do the operations on a byte level or should I convert those numbers so a byte can hold a larger value ? Or is there a way to read numbers more efficiently ?

PS.: Sorry for the long post, I just wanted to give an overall background of my concern so you guys can help me based on it… And for the bad english … I tried to be as clear as I can (English is not my native language but I try to understand it as much as I can… It helps a lot knowing english when I’m programming)

  • 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-15T05:11:49+00:00Added an answer on June 15, 2026 at 5:11 am

    First off, you cannot… I repeat, you cannot compare Assembly to any High Level Language! How they store and interact with data is totally different. They do it their way to make the programmers life easier. If you want to store the ASCII code of a char as a DWORD, go ahead.

    In Assembly, there is absolutely no hand holding. The CPU has no idea what you want to do with any data, be it a byte in a file or a character entered on the keyboard.

    You do everything yourself in Assembly. The characters you press on a keyboard are ASCII because that is what gets displayed when you type them, if you want to do something else with them, you the programmer converts it however you need.

    Converting to an ASCII number to a number is trivial.

    Numbers: 0  1  2  3  4  5  6  7  8  9
    ASCII:   48 49 50 51 52 53 54 55 56 57
    

    See the difference between them? 48 is the magic number.

    You loop through your string, testing each digit to see if is between 48 and 57, anything else skip. If the ASCII char is between 48 and 57, subtract 48 from the character and you have a number. You add 48 to get the ASCII char of the number.

    Not telling you to use a atodw/atoi or whatever, you learn more by doing yourself, and it isn’t hard.

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

Sidebar

Related Questions

I do a lot of XSLT programming. I also do Java, PL/SQL, JavaScript, and
I code for a while now and learned several programming languages. I programmed a
i programmed a tic tac toe game in python and it works perfectly fine
I know this has been asked a lot, but I have a server-side custom
I have programmed in Java some and tried to use net-beans to create a
I studied 2 courses in Java: 1- Introduction to programming with Java. 2- Data
I am applying for a job as java developer. I programmed some hobby apps
I'm an experienced Java programmer that for the last two years have programmed for
I am a Java/C++ programmer and Ruby is my first scripting language. I sometimes
I am a novice programmer in Java. I would like to know how important

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.