Do My Homework
/
Homework Help Answers
/
Coding Homework Help
/ Convert C program into MIPS assembly program using MARS4.5
Convert C program into MIPS assembly program using MARS4.5
Need help with this question or any other Coding assignment help task?
Hello! ***We can talk about the price!*** This is my first time asking for help on a homework, I am currently in a assembly class and have been struggling to come up with a solution. I am to convert a C program into a MIPS assembly program using MARS4.5. For the sort function, implement whichever sort algorithm you want. The function splits the user inputted string into words and sorts them alphabetically. For example the string "hello world foo bar" will be sorted into "bar foo hello world". I linked the C program in a PDF file. I am more than happy to pay more if the program works. DUE WEDNESDAY 11:00PM PST!
Additional Instructions:
#include
#include
/**
* @brief Function finds locations to chars matching the token in given string, stores in an
array of pointers
*/
void delim(char* str, char token);
/**
* @brief Function sorts words from given string into alphabetical order
*/
void sort(char* str, char* loc[], int loc_len);
void main()
{
char str[40];
char* ptr = str;
fgets(ptr, 40, stdin); // Read from the console
delim(ptr, ' ');
printf("\n%s\n", ptr); // Print out string
return;
}
void delim(char* str, char token)
{
char* loc[40] = { NULL }; // Array of substrings
int j = 0; // Number of substrings
int length = strlen(str);
loc[j] = str;
j++;
for (int i = 1; i < length; i++)
{ // Loop cuts up original string
into substrings
if (*(str + i) == token) // And saves start of each substring into location array
{
loc[j] = str + i + 1;
*(str + i) = '\0';
j++;
}
}
sort(str, loc, j);
return;
}
void sort(char* str, char** loc, int loc_len)
{
char buffer[40] = { "\n" };
printf("String -1: %s\n", str); // Implement the sort function of your choice
for (int i = 0; i < loc_len; i++) // Sort words from the user string into alphabetic order
{ // Ex: "hello world foo
bar" sorts->into "bar foo hello world"
printf("String %d:", i); // For debug, remove later
printf("%s\n", loc[i]); // For debug, remove later
}
strcpy(str, buffer);
return;
}
There are no answers to this question.
Login to buy an answer or post yours. You can also vote on other
others
Get Help With a similar task to - Convert C program into MIPS assembly program using MARS4.5
Related Questions
Similar orders to
Convert C program into MIPS assembly program using MARS4.5
10
Views
2
Answers
29
Views
2
Answers
32
Views
2
Answers
21
Views
2
Answers
25
Views
2
Answers
34
Views
2
Answers
36
Views
2
Answers
48
Views
2
Answers
87
Views
2
Answers
144
Views
2
Answers
151
Views
2
Answers
68
Views
2
Answers
67
Views
2
Answers
195
Views
2
Answers
Tutlance Experts offer help in a wide range of topics. Here are some
of our top services:
- Online writing help
- Online homework help
- Personal statement help
- Essay writing help
- Research paper help
- Term paper help
- Do my homework
- Online assignment help
- Online class help
- Dissertation help
- Thesis help
- Proofreading and editing help
- Lab report writing help
- Case study writing help
- White paper writing help
- Letter writing help
- Resume writing help
Post your project now for free and watch professional experts outbid each other in just a few minutes.