Question: Problem 1 - 5 Points Write an assembly program that will put the value 1 into register x 1 0 if the value in x

Problem 1-5 Points
Write an assembly program that will put the value 1 into register x10 if the value in x9 is greater than 0. Else, if the value in x9 is less than 0, x10 should get -1. Else, if the value in x9 is 0, x10 should get 0.
Problem 2-5 Points
Write an assembly program that will square (i.e. raise to the second power) the value in register x4. The result should be stored in register x5. Use only the instructions above. HINT: We dont have a multiplication instruction, but multiplication can be replaced by repeated addition of a number with itself. HINT2: use a loop.

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 Programming Questions!