Question: The do _ add function takes as argument two integers in registers and does the following: 1 . Add the two integers without using the

The do_add function takes as argument two integers in registers and does the following:
1. Add the two integers without using the 'add*' or 'sub*' RISC-V instruction. This
restriction applies to any functions that do_add calls. You may use addi to adjust
the stack pointer if necessary for making function calls. You will likely need to
use the 'or', 'and', 'xor', 'sll', and 'srl' instructions.
2. 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 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 Programming Questions!