Question: 1 - a ) Write a program which gives the summation of three numbers specified by the user at runtime We'll write a program named
a Write a program which gives the summation of three numbers specified by the user at runtime
We'll write a program named add.asm that computes the difference of two numbers specified by the user at runtime, and displays the result on the screen.
The algorithm this program will follow is:
Read the three numbers from the user. We'll need three registers to hold these two numbers. We can use $ to and $ for this.
a Get first number from user, put in to $
i load syscall readint into $
ii perform the syscall, iii. move the number read into $
b Get second number from user, put into $
i load syscall readint into $v
ii perform the syscall, iii. move the number read into $
c Get third number from user, put into $
i load syscall readint into $
ii perform the syscall, iii. move the number read into $
Compute the summation $$$ We'll need a register to hold the result of this summation. We can use $ for this.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
