Question: Write a MIPS assembly language program that converts ASCII binary to decimal using MARS. It will do the following tasks. 1) Read a user entered

Write a MIPS assembly language program that converts ASCII binary to decimal using MARS. It will do the following tasks.

1) Read a user entered program argument (8 bit two's complement binary number) , then prints the user input

2) Convert the ASCII string into a sign-extended integer value, and store it in $s0.

3) Convert the sign-extended integer value to an ASCII string that displays the value as a hexadecimal number. Then print the ASCII string.

4) Covert the sign exteded integer value to an ASCII string that displays the value as a decimal number. Then print the ASCII string

Output Example

You entered the binary number:

11111100

The hex representation of the sign-extended number is:

0xFFFFFFFC

The number in decimal is:

-4

Notes:

For the user input, don't use syscall but use the program arguments which can be found in MARS settings and says "Program arguments provided to MIPS program."

When printing the decimal representation, do not you syscall service 1.

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 Databases Questions!