Question
5. The NOP instruction is a Pseudo Assembler instruction. Meaning that there is no opcode assigned as a NOP, but the compiler/assembler will substitute an
5. The NOP instruction is a Pseudo Assembler instruction. Meaning that there is no opcode assigned as a NOP, but the compiler/assembler will substitute an existing instruction in the RISC V architecture set. Provide an instruction or set of instructions that provide the following Pseudo instructions.
5a. neg
5b. 'mv' copy the contents of one register to another
5c. Find the shortest sequence of RISC V instructions to determine a "set min" operation value of a two's complement integer. i.e. Convert this pseudo instruction to a set of RISC V assembly instructions.
min x10, x11, x12
5d. Write the RISC-V assembly code to implement the following C code as an atomic "set max" operation using the lr.d/sc.d instructions. Here the argument shvar contains the address of a shared variable which should be replaced by x if x is greater than the value it points to. (problem 2.37 in the text)
Step 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