Completed

Write a MIPS program string to int

Write a MIPS assembly language function with the following characteristics:

1)Obeys all applicable MIPS function calling conventions

2)Takes two arguments:

[url removed, login to view] argument: address of a null terminated string

[url removed, login to view] argument: An integer in the range of 2 to 16, inclusive

3)Returns an integer result

The first argument is the address of a sequence of digits, possibly starting with a “-“ (minus) sign. The function steps through the string of characters (in an appropriate direction) and converts the string to asigned integer value, assuming the integer base value given in the second argument. Negation is to be 2’s complement.

You can assume the following:

1)The first argument is a legitimate address, indicating the first character of a

string of characters.

2)The string of characters is terminated by a null character “\0”. This character is not considered part of the string.

3)It is possible the string is empty, that is, the character at the address in the first argument is the null [url removed, login to view] this case, a return value of zero is appropriate.

4)The result will fit into a 32-bit integer You may NOT assume all the characters in the string are legal with respect to the base argument. That is, you could encounter characters other than 0, 1, 2, 3, 4, 5, 6 and 7 when converting a base 8 number.

If any character is encountered which is not a legal digit for the base given, print an error message and return a zero result. Bases larger than 10 will use the upper case letters A, B, C, D, E and F as the digits larger that 9. Lower case letters will not be recognized as legal [url removed, login to view] string argument may begin with a “-“ sign indicating a negative number. In this case, convert the remaining digits and perform a 2’s complement operation before returning the result value. A minus sign is only permitted as the first character of the string. A plus “+” character is never legal in the string.

If the second argument is not in the range of 2 through 16 (inclusive), print an error

message and return a zero value.

Skills: Assembly, Software Architecture

See more: write a program in mips assembly language to convert an ascii number string, convert ascii string to integer assembly, mips split string, mips convert string to integer, mips convert string to ascii, write a program in mips assembly language to convert an ascii, mips parse string, convert ascii to decimal in mips, write mips assembly program following program, write mips program matrix addition, write mips program sort numbers, write mips assembly language program, write mips assembly program floating point addition, write mips assembly program calculate sum floating point numbers, write mips assembly language program mars simulator prompt user string process string character time display specific informatio, mips assembly convert string int, write mips assembly program reads integers prints largest, write mips program multiply, write mips assembly, write mips assembly code inside

About the Employer:
( 2 reviews ) Vancouver, United States

Project ID: #15846931

Awarded to:

ched41

I specialize in low-level assembly programming and embedded systems. Please contact me with more details of your job. Stay tuned, I'm still working on this proposal.

$45 USD in 1 day
(7 Reviews)
3.3

2 freelancers are bidding on average $35 for this job

$25 USD in 1 day
(5 Reviews)
3.1