Question: Skeleton code in lab 1 . s already has the instructions to read two integer and save them in s 1 and s 2 .

Skeleton code in lab1.s already has the instructions to read two integer and save them in s1 and s2. Implement the following steps with RISC-V instructions to complete the program.
Compute the GCD of the two numbers with Euclidean algorithm by subtraction. We recommand the following two steps.
Write the while loop.
Write the if-else statement inside the loop.
Print the GCD in decimal with a system call.
The list of system calls is in RARS's help file. Select menu "Help/Help" and then select "Syscalls" tab. Scroll up to the beginning of the page if necessary. There is an example before the table.
The skeleton code also has examples of system calls, two for reading integers and one for terminating the program. Check wether you can write the instructions from the information in the system call table. With the system call for printing the result, the submitted code has four system calls.
Testing

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!