Question: Translate the following RISC-V function F1 into machine code both in binary and hexadecimal: F1: addi x9, x0, -5 L2: add x10, x0, x9

Translate the following RISC-V function F1 into machine code both in binary and hexadecimal: F1: addi x9, x0, -5 L2: add x10, x0, x9 sw x10, 20 (x0) L1: lw x11, 20 (x0) beq x9, x11, L1 jal x0, L2 lui x8, 65 auipc x9, 321 jalr x9, 80 (x1) If a caller uses the instruction: jal x1, F1 residing at address 9200 to call the F1 function residing at address 2800, what would be the final values of x0, x1, x8, x9, x10, and x11 at return time? What will be the values of the PC and of x9 immediately after the execution of the auipc instruction?
Step by Step Solution
There are 3 Steps involved in it
To translate the RISCV function F1 into machine code well assume a 32bit RISCV instruction set archi... View full answer
Get step-by-step solutions from verified subject matter experts
