More about Linux assembly language .
Standard input. Standard output.
Instead of posting more code, I'm going to comment about code that has already been posted. The code I posted was from the book Assembly language step-by-step programming with Linux, third edition. Yes, third edition really is different from his earlier works. It still is a teaching book ,an introduction to assembly language, but with much more attention to what you can do in Linux.
Now looking at the code earlier posted, notice there is an input routine that can be called the standard input device. Likewise the output routine is called the standard output device. These are handled by the kernel in the proper way so that input comes from the keyboard and the output goes to your display. Of course the display in this case is going to be a console or terminal in Linux. When a user types on the keyboard there's a number of things that happen at the hardware level, and we're just interested in getting the keystrokes in the ASCII format. The standard input takes care of this. Therefore, when the user hits he letter A the standard input will get the number 65. If it was the letter B. it will be 66 and so on. That is for uppercase. In the program posted you will note that he makes a test to see if the letters are in the range of lowers case. In the standard ASCII table the lower case letters are actually higher up. Therefore if the user typed an lowercase letter the program will subtract a certain value in order to force it to uppercase. After the entire buffer has been processed for as many characters that are actually in the buffer, it is sent to the standard output device and we will see uppercase letters where ever the user typed lowercase letters. This is a fairly good teaching exercise to introduce the ideas of standard input, standard output, use of the ASCII table and how to force a conversion of a character. The individual letters we call characters here or, using the C lingo, we call them chars, rhymes with cars.
Now why is it so important to know how to do standard input and standard output? Because this opens the door of using files instead of simply the console for input and output . In Linux you can do redirection so that input and output come from a file and go to file. This is one of the main points that he makes in the book . Once you've got that under your belt you can do lots of interesting things and create some very useful utilities that use the standard input and output. That way you don't have to deal with the issues of opening up a file and making sure the file exists and can be written to. The kernel will take care of all the error trapping and stop your program if there's an error with the file system.
Your original question was about how to get numbers into a memory location using Linux assembly language. I'll explain more about that in the next post. But first I wanted you and anybody else reading this understand why we have to learn the standard input and output in Linux. Once over that hurdle we can go on to do other things.
I had to do this with dictation, so there probably are some funny errors. I had to get back to work, it's my turn to mop the floor.
(microphone off)