Question: Problem 1 : Translate the following RISC - V function F 1 into machine code both in binary and hexadecimal: F 1 : addi x

Problem 1:
Translate the following RISC-V function F1 into machine code both in binary and hexadecimal:
F1: addi x2,x2,-4
Sw x22,0(x2)
lui x22,1022
ori x22,x22,124
blt x21,x22,L1
add x23,x20,x20
beq x7,x7,Ex
sub x23,x20,x20
lw x22,0(x2)
addi x2,x2,4
jalr x0,O(x1)
If a caller uses the instruction:
jal x1, F1
residing at address 8420 to call the F1 function residing at address 2024 and if the values of x1,x2,x7,x20,x21,
x22, and x23 were 1200,6000,134,-32,385,-738, and 1100 respectively at call time, what would be their final
values at return time? Also, what will be the value of 22 immediately after the execution of the ori instruction?
 Problem 1: Translate the following RISC-V function F1 into machine code

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 Databases Questions!