1. (25 points) Write the RISC-V assembly code for the following C code. Take a screenshot of your completed assembly cod

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

1. (25 points) Write the RISC-V assembly code for the following C code. Take a screenshot of your completed assembly cod

Post by answerhappygod »

1 25 Points Write The Risc V Assembly Code For The Following C Code Take A Screenshot Of Your Completed Assembly Cod 1
1 25 Points Write The Risc V Assembly Code For The Following C Code Take A Screenshot Of Your Completed Assembly Cod 1 (146.96 KiB) Viewed 61 times
1 25 Points Write The Risc V Assembly Code For The Following C Code Take A Screenshot Of Your Completed Assembly Cod 2
1 25 Points Write The Risc V Assembly Code For The Following C Code Take A Screenshot Of Your Completed Assembly Cod 2 (62.06 KiB) Viewed 61 times
1 25 Points Write The Risc V Assembly Code For The Following C Code Take A Screenshot Of Your Completed Assembly Cod 3
1 25 Points Write The Risc V Assembly Code For The Following C Code Take A Screenshot Of Your Completed Assembly Cod 3 (51.4 KiB) Viewed 61 times
1. (25 points) Write the RISC-V assembly code for the following C code. Take a screenshot of your completed assembly code. Skeleton is provided (hw2_1_skeleton.s). Assume that the register x10 holds the base address of array A. The length of array A is stored in the register x11. Registers x5, x6, and x7 hold the values of i, j, and temp, respectively. 2

= = = O O OCTA co N A 1 for (i = 0; i < LENGTH; i++) { 0 2 for (j = i + 1; j < LENGTH; j++) { 3 if (A > A[j]) { 4 temp = A; 5 A A [j]; 6 A [j] = temp; 7 } 8 } 9} =

.data A: .word 27,20,2,24,7,19,2, 10, 10,22 .text la x10, A addi x11, x0, 10 addi x5, 0 addi x6, xe, 0 addi x7, x0 0 х0, # put the base address of array A in x10 # put the length of array A in x11 # the temperary variable i # the temperary variable j # the temperary variable temp # insert your code here exit: nop
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply