Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program which prints the sum of two numbers taken from user at runtime . We'll write a program named add2.asm that computes the
Write a program which
prints the
sum of two numbers
taken
from
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 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 to. i. load syscall read_int into v0, iii. move the number read into St0. i. load syscall read_int into v0, iii. move the number read into t1. i. perform the syscall, b. Get second number from user, put into $tl i. perform the syscall, 2. Compute the sum. We'll need a register to hold the result of this addition. We can use St2 for this. 3. Print the sumStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started