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

1- 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 $t1 for this.
a. Get first number from user, put in to $t0.
i. load syscall read_int into $v0,
ii. perform the syscall, iii. move the number read into $t0.
b. Get second number from user, put into $t1
i. load syscall read_int into $v0,
ii. perform the syscall, iii. move the number read into $t1.
c. Get third number from user, put into $t2
i. load syscall read_int into $v00,
ii. perform the syscall, iii. move the number read into $t2.
Compute the summation $t0+$+1+$+. We'll need a register to hold the result of this summation. We can use $t3 for this.
 1- a) Write a program which gives the summation of three

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!