Read an unsigned integer

The next step is reading an integer from the input device.

Assignment

For this assignment you have to write a program that reads in an unsigned 64-bit integer. In order to keep it simple you can assume that the user types in a sequence of decimal digits that is terminated with a newline character. You don't have to do any error handling, i.e. you can assume that at least one digit gets typed in.

The next assignment will be about printing an unsigned integer. Until then we need to use a more primitive method to communicate to the outside world what integer value the program recognized. For this assignment use the exit code of the integer. Note however, that the exit code is a 8-bit value. So when you check the exit code on the command line with echo $? you will get the integer modulo 256.

Submit the assignment on theon as follows:

1
submit hpc quiz03 readuint.s

Video tutorial