Question: Part 1.2 Saving Registers We've defined a new mathmatical operation, o, and written an ABI-complaint function that im plements it. The operation is binary: it

Part 1.2 Saving Registers We've defined a new mathmatical operation, o, and written an ABI-complaint function that im plements it. The operation is binary: it takes two inputs, and produces one output. We won't tell you what the operation is (it's a mystery!), but we can say that o is a commutative and associative operation. This means that a ob boa, and that (aob) oc ao (boc). Our function is named op_two, and takes two 32-bit inputs a and b, and returns a single 32-bit value aob. Your task is to implement an ABI-compliant op_three function in Nios II assembly, that inputs three 32-bit inputs, a, b, and c, and returns aoboc. The type signature of the given function is int op_two(int a, int b), and your function's type signature should be int op_three(int a, int b, int c) Note that you don't know what operation o is, so you'll have to rely on calling op_two to perform that for you! Your function should work for any operation we implement in op_two. At the very least, you should test it with your above sum two function as the op two function, but we encourage you to try it with other commutative/associative functions, such as multiplication, minimum integer, bitwise xor, etc. Make sure you don't leave a op_two function in your submission! We'll define one, and use it to test your program Part 1.2 Saving Registers We've defined a new mathmatical operation, o, and written an ABI-complaint function that im plements it. The operation is binary: it takes two inputs, and produces one output. We won't tell you what the operation is (it's a mystery!), but we can say that o is a commutative and associative operation. This means that a ob boa, and that (aob) oc ao (boc). Our function is named op_two, and takes two 32-bit inputs a and b, and returns a single 32-bit value aob. Your task is to implement an ABI-compliant op_three function in Nios II assembly, that inputs three 32-bit inputs, a, b, and c, and returns aoboc. The type signature of the given function is int op_two(int a, int b), and your function's type signature should be int op_three(int a, int b, int c) Note that you don't know what operation o is, so you'll have to rely on calling op_two to perform that for you! Your function should work for any operation we implement in op_two. At the very least, you should test it with your above sum two function as the op two function, but we encourage you to try it with other commutative/associative functions, such as multiplication, minimum integer, bitwise xor, etc. Make sure you don't leave a op_two function in your submission! We'll define one, and use it to test your program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
