Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program asks the user for a string named string and two characters (one for original and one for new). It then replaces each instance

image text in transcribed
This program asks the user for a string named string and two characters (one for original and one for new). It then replaces each instance of the character original found in string with the character new. It outputs the resulting string and the number of substitutions that were made. For example, if string was "sassy" original was 's and new was'p' the program would output the resulting string of "pappy" and 3 as the number of substitutions A MIPS assembly file substitute.s in assignment2 directory contains the code to get the string and two characters for you. It then contains the commented-out C code to do the real work. You should translate the C code to MIPS and add syscalls to output the results. I suggest that you do it in two steps, just like we have been practicing. Create substitute C code that uses labels and goto's. Dont try to write the MIPS code directly! try not to take shortcuts. Make a dumb translation that works first, even if its longer. Then do some optimizations if you like. (Actually, the use of an index is silly here. Can you get rid of the Hint:The program contains suggestions about placing certain variables in certain registers prior to the C section. If you follow this, it will be much easier to use this program in a later exercise set. When you need other registers, use t-registers like Sto

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Discuss the key roles for training professionals.

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago