Question: Programming Language: MIPS Assembly Language 1-a) Write a program which sums two numbers specified by the user at runtime We'll write a program named add2.asm
Programming Language: MIPS Assembly Language


1-a) Write a program which sums two numbers specified by the user at runtime We'll write a program named add2.asm that computes the sum of two numbers specified by the user at runtime and displays the result on the screen. The algorithm that this program will follow is: 1. Read the two numbers from the user. We'll need two registers to hold these two numbers. We can use $t0 and $t1 for this. a. Get first number from user, put into $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. 2. Compute the sum. We'll need a register to hold the result of this addition. We can use $t2 for this. 3. Print the sum. 4. Exit. We already know how to do this, using syscall. 1-b) Modify the above program to show sum of two numbers specified by the user at runtime in Hexadecimal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
