Question: You will develop RISC - V assembly language implementations of the following problem and print the results to ensure that both the C implementation and
You will develop RISCV assembly language implementations of the following problem and print the results to ensure that both the C implementation and your RISCV 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 RISCV 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.
rstr: Reverse a string
$ rstr a
C: a
Asm: a
$ rstr FooBar
C: raBooF
Asm: raBooF
$ rstr CS Computer Architecture"
C: erutcetihcrA retupmoC SC
Asm: erutcetihcrA retupmoC SC
C code we must follow
#include
#include
void rstrcchar dst char src
int srclen strlensrc;
int i j;
for i j srclen ; i srclen; i j
dsti srcj;
dstsrclen;
rstrrec: Reverse a string recursively
$ rstrrec a
C: a
Asm: a
$ rstrrec FooBar
C: raBooF
Asm: raBooF
$ rstrrec CS Computer Architecture"
C: erutcetihcrA retupmoC SC
Asm: erutcetihcrA retupmoC SC
C code we need to follow
#include
#include
void rstrrecfunccchar dst int dstidx, char src int srcidx
if srcsrcidx
dstdstidx;
return;
Copy the current character from the end of src to the start of dst
dstdstidx srcsrcidx;
rstrrecfunccdst dstidx src srcidx ;
void rstrreccchar dst char src
int srclen strlensrc;
rstrrecfunccdst src srclen ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
