Question: Two C functions (stringlen.c and StringReverse.c) are shown in the following with the function defined as: stringlen - find the length of a string, input:

  1. Two C functions (stringlen.c and StringReverse.c) are shown in the following with the function defined as:

stringlen - find the length of a string, input: pointer to a string

StringReverse reverse the letters of a string, input: pointer to a string

Writebothin MIPS assembly language code.

uint8_t stringlen(const uint8_t str[])

{

uint8_t index=0;

while(str[index]!=0)

{

index++;

}

return index;

}

void StringReverse(uint8_t str[])

{

uint8_t i=0;

uint8_t j=stringlen(str)-1;

uint8_t temp;

while(i)>

temp=str[i];

str[i]=str[j];

str[j]=temp;

i++;

j--;

}

}

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