Write a MIPS program (which must be named as “hw4_prob1.s”) that will read in a value (nonnegative integer but as an ASCII string) in base 64 and print out the decimal value; you must implement a function (which accepts an address for a string as the parameter, and returns the value) and call the function from the main program. The valid digits for the values will be in set [A..Z, a…z, 0…9, +, /] (which are mapped to 0 to 63 in the given order) and ” and ‘n’ indicate the end of the string; any other character is considered to be invalid. You can assume that no overflow will occur. An example run will be: Enter a number in base 64: 09 The value in decimal is: 3389 Then you need to test program using the above case and the following cases and include the results in the pdf file you need to submit. Enter a number in base 64: AcZd18 The value in decimal is: 476437884 Enter a number in base 64: 09az+/ The value in decimal is: 1030438847 Enter a number in base 64: 123*@[: The input is not a valid base64 number. The input and output can be done using syscalls in MIPS that are given on p. A-44. Here is the base64 table:
The post Write a MIPS program (which must be named as “hw4_prob1.s”) that will read in a appeared first on Get Papers.
Source: My posts