Question: 1 you will develop riscv assembly language implementations of You will develop RISC - V assembly language implementations of the following problem and print the

1 you will develop riscv assembly language implementations of
You will develop RISC-V assembly language implementations of the following problem and print the results to ensure that both the C implementation and your RISC-V implementation compute the correct answer.
Your executables must be named as follows, and must be compiled with a Makefile
We will test your projects using autograder
Note that in all your programs below you must follow the RISC-V function calling conventions that we cover in class.
Your solutions must follow the logic and implement the same functions as given in the C code.
Remeber to remove the line # YOUR CODE HERE from the starter code.
findmaxll Find the maximum value in a linked list.
$ ./findmaxll 12349956789
C: 99
Asm: 99
C code we need to follow
#include
#include "linkedlist.h"
int findmaxll_c(struct node_st *np){
int v;
int max;
max = np->value;
np = np->next_p;
while (np != NULL){
v = np->value;
if (v > max){
max = v;
}
np = np->next_p;
}
return max;
}
findmaxllp Find the maximum value in a linked list and print the list elements using printf while traversing the list.
$ ./findmaxllp 12349956789
v =1
v =2
v =3
v =4
v =99
v =5
v =6
v =7
v =8
v =9
C: 99
v =1
v =2
v =3
v =4
v =99
v =5
v =6
v =7
v =8
v =9
Asm: 99
C code we need to follow
#include
#include
#include "linkedlist.h"
int findmaxllp_c(struct node_st *np){
int v;
int max;
max = np->value;
printf("v =%d
", max);
np = np->next_p;
while (np != NULL){
v = np->value;
printf("v =%d
", v);
if (v > max){
max = v;
}
np = np->next_p;
}
return max;
}

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!