Question: Each will be described below and then the grading process will be described at the end. There are six functions described along with appropriate return

Each will be described below and then the grading process will be described at the end. There are six functions described along with appropriate return values. Each of these functions should be run be the final program with test data to demonstrate functionality. I am introducing the functions from easiest to hardest but you may skip around.
void toUpper(*string, int)- This function will change all lower case letters to upper case and ignore all other characters. The string should be terminated by NULL and to prevent overflow a maximum number of characters will be permitted. The function will terminate when it finds a NULL or has checked the maximum number of characters.
rdi will hold the address of a NULL terminated string.
rsi will be the maximum number of characters the string will check.
void toLower(*string, int)-This function will change all upper case letters to lower case and ignore all other characters. The string should be terminated by NULL and to prevent overflow a maximum number of characters will be permitted. The function will terminate when it finds a NULL or has checked the maximum number of characters.
rdi will hold the address of a NULL terminated string.
rsi will be the maximum number of characters the string will check.
int strnlen(*string, int)- This function will walk a string and count the number of characters through NULL. To prevent overflows a maximum number of characters will be checked. The function will return the length of the string including the NULL or the maximum value. If the maximum size is reached then the function will overwrite the last character in the string with a NULL.
rdi - a string address that is NULL terminated.
rsi - the maximum number of characters.
return rax - the number of characters in the string including the NULL.
int strncpy(*string,*string, int)- This function will copy a string from one memory location to another. The string will terminate the copy when NULL is found in the source string or the maximum length of the destination string has been reached. If the source string is longer than the destination string a NULL will be placed in the last character of the destination string. The function will return the number of characters copied.
rdi - string address of the source to be copied.
rsi - string address of the destination string.
rdx - the size of the destination string.
return rax - the number of characters copied.
int strsplit(*string,*string, int, int)- This function will copy strings from a compressed buffer of strings separated by returns (LF) to an array of strings with a fixed string length and a fixed number of elements. Each LF at the end of the strings will be replaced with a NULL byte. The function returns the number of strings copied into the array.
rdi - a buffer address containing multiple strings terminated with LFs.
rsi - an array address of the first string element.
rdx - an integer representing a string's maximum length in the array.
r10- an integer representing the number of array elements.
return rax - the number of elements copied into the array.
int strcat(*string, int, int, *string)- This function will take an array of strings, each terminated with NULL, and concatenate those strings into a buffer separated by LFs. The parameters will identify the maximum size of the array strings and the maximum number of strings in the array. The function will return the total length of the new string.
rdi - array starting address containing all of the strings.
rsi - the maximum string's size in the array.
rdx - the number of strings in the array.
r10- the buffer address for the concatenated string.
return rax - the total size of the string in the buffer.
For each level a function must be complete and work properly.
60- complete two functions.
70- complete three functions.
80- complete four functions.
90- complete five functions.
100- complete six functions.
NOTE: Each of these functions can help you complete the final assignment at the 100% level.

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!