Search for question
Question

The programs are described below: 1. Write an assembler language program called pl.asm that prompts the user for two single digit numbers. Once the user has entered the two numbers, the program will add them together, via the add instruction, and print the results. Note that when the numbers are entered, they will be in string form and you will have to convert them into numbers. To convert a single digit number represented as a string into an actual number, you must subtract 48 from it (which is the ASCII code for the character '0'). For example, '5' -'0' is 5, and '1'-'0' is 1. You will also need to convert the answer back to a character representation so that it prints correctly. To turn a single digit number into a character representation, add a 48 to it. For example, 5 + '0' is '5', and 1 + '0' is '1'. The algorithm for this first program is below: 1. prompt the user for a single digit number 2. read the number from the keyboard 3. prompt the user for the second single digit number 4. read the second number from the keyboard 5. convert the first number represented as a string to a number by subtracting 48 from it (if the first number is in al, then all you have to do is: sub al, '0') 6. convert the second number represented as a string to a number by subtracting 48 from it 7. add the first number to the second number and save the answer 8. convert the answer from a number to a string by adding 48 to it 9. print "The answer is: " 10. print the saved answer You can assume the the user will only enter a 1 digit number, so you do not have to do any input checking for this assignment. Also you may assume the the addition of the two numbers will result in a single digit number (of course, this assumption is not valid

Fig: 1