5. Convert the following high-level code into RISC-V assembly language. Assume that the signed integer variables g and ʼn are in registers to and t1, respectively. You can use other temporary registers like t2 and t3 if needed. a) b) if (g % 8 == 3 || g % 8 == 5) h = h 5.5; else h = h % 16; if (g % 16 > 4 && g % 16 < 12) h = (g + 5 * h) % 8; else h = (g+ 8.5 * h) * 9;
5. Convert the following high-level code into RISC-V assembly language. Assume that the signed integer variables g and ʼn are in registers to and t1, respectively. You can use other temporary registers like t2 and t3 if needed. a) b) if (g % 8 == 3 || g % 8 == 5) h = h 5.5; else h = h % 16; if (g % 16 > 4 && g % 16 < 12) h = (g + 5 * h) % 8; else h = (g+ 8.5 * h) * 9;
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.1: Addresses And Pointers
Problem 7E
Related questions
Question
ONLY USE RISC-V assembly code. DO NOT USE nor, li, etc....
![5.
Convert the following high-level code into RISC-V assembly language. Assume
that the signed integer variables g and ʼn are in registers to and t1, respectively. You can
use other temporary registers like t2 and t3 if needed.
a)
b)
if (g % 8 == 3 || g % 8 == 5)
h = h * 5.5;
else
h = h 16;
if (g % 16 > 4 && g % 16 < 12)
h = (g + 5 * h) % 8;
else
h = (g + 8.5 * h)
* 9;](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F9f5c46b0-e9ff-4672-89bb-36325b9de9d1%2F37032571-27ee-4c02-9a8e-b2620a95788f%2Fxfga16p_processed.png&w=3840&q=75)
Transcribed Image Text:5.
Convert the following high-level code into RISC-V assembly language. Assume
that the signed integer variables g and ʼn are in registers to and t1, respectively. You can
use other temporary registers like t2 and t3 if needed.
a)
b)
if (g % 8 == 3 || g % 8 == 5)
h = h * 5.5;
else
h = h 16;
if (g % 16 > 4 && g % 16 < 12)
h = (g + 5 * h) % 8;
else
h = (g + 8.5 * h)
* 9;
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning