Question: Requirements Your code must be well - commented to receive full credit. This means any non - trivial line of code should have an accompanying
Requirements Your code must be wellcommented to receive full credit. This means any non trivial line of code should have an accompanying comment. For examples of appropriate comments, refer to any of the code examples on Canvas. Your function must be called convert hex str Your function must accept one input value, a pointer to the string, in register $ao You must not modify the string during processing. Your function will return two values in two registers a $v: The converted integer value. It must contain an integer that corresponds to the value represented by the string passed to the function. The string is considered a hexadecimal representation of an unsigned integer that fits in bits. $v: An error status. means no error. means overflow error. If an error is returned, the integer value in Sv is ignored and can be any value. b Your function should not invoke any syscalls, You do not need to print output or read keyboard input. That is all done by the test harness. The input string will consist of: a Digit characters O b Hexadecimal letter characters, either upper or lower case afAF A NUL terminator c You may assume the input string follows this format. Your function will not be tested with improperly formatted strings, and there are no behavioral requirements if the string is not properly formatted. Overflow. You are returning a normal b signed twoscomplement integer. Even though the value will always be nonnegative, $vO uses signed form. What is the largest positive value that can be represented? If the input string represents a value larger than this, your function should report an error by returning in $v
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
