Question: give me example of risc - v code that The do _ sub function takes as argument two integers in registers and does the following:
give me example of riscv code that "The dosub function takes as argument two integers in registers and does the following:
Subtract the second integer from the first without using the 'sub or 'add RISC
V instructions. You may however use addi to adjust the stack pointer. You should
take the s complement of the second integer, and then call doadd. Note: to take
the s complement you should use 'nor', 'ori', and a call to doadd, thus there will
be two calls to doadd!
Return the result in a register. If there is an arithmetic overflow, return an error
condition identifying that an overflow occurred in another register."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
