Write the ARM assembly codes that describes the following C string functions. As
ID: 2080033 • Letter: W
Question
Write the ARM assembly codes that describes the following C string functions. Assume that each string is stored as one character per byte. Assume also that each string is terminated by the null character (0 times 00); strlen(str 1): The function takes one sting argument; str 1 and returns the length (number of characters) of str 1. The string is stored in the memory address pointed to by pointer str 1. The return value should be stored back in the memory location pointed to by the pointer length. strcomp(str 1, str2): The function compares two string arguments; stings str 1 and str2 and returns 0 if both strings are identical (equal), or 1 if they are not. Assume the two stings are stored in the two memory addresses pointed to by pointers str 1 and str 2, respectively. The return value should be stored back in the memory location pointed to by the pointer value. strcat(str 1, str2). The function concatenates two strings to form a one string. The function takes two arguments; stings str 1 and str 2 and stores the concatenation of both strings. Assume the two stings are stored in the two memory addresses pointed to by pointers str 1 and str2, respectively. The resultant concatenated string is stored back at the first string specified in the argument.Explanation / Answer
1. Assembly Code for String Length
2. Assembly Code for String Compare
3. Assembly Code for String cat
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.