Question: Consider the following RISC-V program segments. Assume that the variables a, b, c and d are assigned to registers x10, x11, x12 and x13

Consider the following RISC-V program segments. Assume that the variables a, b, c and d are assigned to 

Consider the following RISC-V program segments. Assume that the variables a, b, c and d are assigned to registers x10, x11, x12 and x13 respectively and the base address of array A is in register x20. a. add x10, x10, x11 sub x10, x13, x12. add x10, x10, x11 b. addi x21, x20, -12 add x21, x21, x11 1w x10, 16 (x21) Answer the following: 1- 2- 3- For the instructions above, what is the corresponding C statement? For the assembly above, assume that the registers x10, x11, x12, x13, contain the values 10, 20, 30, and 40, respectively. Also, assume that register x20 contains the value 800. You can refer to memory locations contents using the notation "Mem[adr]"; e.g., the word stored at address 800 can be refered to as Mem[800]. Find the value of x10 at the end of the assembly code. For each RISC-V R-type instruction, show the values of the of rs1, rs2, and rd fields. For each I-type instruction, show the value of the rs1, rd, and immediate fields. Activate WindowsS

Step by Step Solution

3.35 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Given Assembly Code a add x10 x10 x11 sub x10 x13 x12 add x10 x10 x11 b addi x21 x20 12 add x21 x21 ... View full answer

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!