Question: Task 1 AddTwo ( 4 0 pts ) A . ( 5 pts ) Download the addTwo.c code from iCollege and compile the binary and

Task 1 AddTwo (40pts)
A.(5 pts)Download the addTwo.c code from iCollege and compile the binary and
assembly of this program using gcc. The GNU compiler will return an assembly code
of addTwo.c using AT&T syntax, see below:
CSC 3210- Computer Organization
Fall 2024
Instructor: Jean Guo
B.(10 pts)Convert the above code, addTwo.s to NASM, and run the following test cases:
a. a=5, b=6
b. a=-8, b=6
c. a=2147483647, b=2
d. a=99999999999999 b=3
e. a=-2147483648 b=-1
C.(10 pts)For cases in B that return the wrong results, explain why the code does not
give the correct result.
D.(15 pts)Convert addTwo.s to RISC-V and run the same test cases in B

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!