Write a program in assembly language (MIPS) that asks the user for an integer N and then adds up the first N odd integers. Use a loop for this. Use instructions and pseudo instructions up to chapter 24. Use exception handler services for input and output. How many odd numbers: 10 The sum: 100 If the user enters a negative integer or non-integer, just print a zero. Set SPIM options to the following: OFF Bare Machine OFF Enable Delayed Branches OFF Enable Mapped IO ON Accept pseudo instructions ON Load Exception Handler OFF Enable Delayed Loads
Write a program in assembly language (MIPS) that asks the user for an integer N and then adds up the first N odd integers. Use a loop for this. Use instructions and pseudo instructions up to chapter 24. Use exception handler services for input and output. How many odd numbers: 10 The sum: 100 If the user enters a negative integer or non-integer, just print a zero.
Set SPIM options to the following:
OFF Bare Machine
OFF Enable Delayed Branches
OFF Enable Mapped IO
ON Accept pseudo instructions
ON Load Exception Handler
OFF Enable Delayed Loads
In the previous solutions you have given, when you add the first four integers the sum is supposed to be 16, not 25. And the comment for the statement ble $t2,$s0,loop was if t0 less than s1 jump, isn't it supposed to be if $t2<=$s0 then do the loop again? Can you please tell me what to change?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps