Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to know why is the following answer correct in detail? Translate the following RISC-V function F1 into machine code both in binary and
I need to know why is the following answer correct in detail?
Translate the following RISC-V function F1 into machine code both in binary and hexadecimal: F1: addi x7, x7, -4 sw x21, 0 (x7) addi x5, x5, 12 auipc x21, 20 andi x21, x21, 331 blt x11, x21, L1 sub x10, x11, X10 beq x29, x29, Ex sub x10, x10, x11 lw x21, 0(x7) addi x7, x7, 4 jalr x3, 4(x4) Ll: Ex: If a caller uses the instruction: jal x4, F1 residing at address 400 to call the F1 function residing at address 1200 and if the values of x7, x10, x11, and x21 were 6000, 415, 402, and -138 respectively at call time, what would be the final values of x0, x3, x4, x7, x10, x11, and x21 at return time? Also what will be the value of the PC and of x21 immediately after the execution of the auipc instruction? The final values of x0, x3, x4, x7, x10, x11, and x21 are 0, 1248, 404, 6000, -13, 402, and -138 respectively. Immediately after the execution of auipc instruction, the PC and x21 values will be 1216 and 83132 respectivelyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started