prepare assembly code that performs each of these four tasks. Create a single assembly file (.asm) per task.
For this assignment, you must create a Design Summary Document. For each part of the assignment, you must describe in English how your code works. A paragraph or set of bullet points for each part of the assignment will suffice. Submit this as a single document. Number each section corresponding to each part of the assignment.
Read the instructions carefully before attempting each problem.
1) Create a program that takes two single digit numbers from simple keyboard input and adds them together. Print the answer to the VDU.'
A) Your program must be capable of printing a two digit answer.
For ex, if the input is 8 and 9, the answer printed must be 17 (a 1 in one VDU memory slot, and a 7 in another beside it).
B) Your program must be capable of handling nonGnumeric character input. If an input character is not a number, reGprompt for input. Keep doing so until a valid character is entered (i.e. 0G9).
2) prepare a similar program, this time show the sum on the VDU as in the screenshot below.
Print the input numbers to the VDU as they are input, then print out the answer below the line.
o Numbers must be displayed as they are input.
o Once all numbers are input, only then can you add them together and display the result.
o Again, your program must check if the input characters are valid.
o Use the DB and ORG directives to print the “G“ and “+” characters to the screen.
3) Create a similar program that adds two 2 digit numbers together.
o The user must input the first number, rightGtoGleft, then the second number to be printed below the first as in the screenshot. After each digit is entered, print it to the screen. Hints:,
o In order to prepare a solution for this, think about how you add numbers on paper (“carry the one”).
o You are performing a repetitive task on each column of numbers. As such you should prepare a procedure that takes two numbers as input and prints the answer to the VDU.
o You should also prepare a procedure that gets input for each 2Gdigit number and prints it to the screen (digit by digit).
o For answers that are greater than 10 (0A in Hex), you may want to use a “carryOne” flag. (a memory slot that contains either a 1 or a 0).
4) Extend your program from part 3 to create an adder for two 8 digit numbers.
User has input first 5 digits of the first number
User has input first 4 digits of second number
The program has completed.
o Because of memory constraints, you now must create two procedures to carry out repetitive tasks.
- One procedure takes input from the keyboard and prints an 8Gdigit number to the VDU. This will be called twice – one for each number.
- One procedure that takes two numbers, adds them, and prints the answer to the VDU (dealing with the “carry one” issue).