Question: This should be coded using x 8 6 including Irvine 3 2 library. Ensure that the code is able to run and debug on visual
This should be coded using x including Irvine library. Ensure that the code is able to run and debug on visual studio
Create a procedure named StringConcat which takes two strings and concatenates them.
This procedure should receive a stack frame with variables: the offsets of two strings being concatenated, their lengths, the offset of the destination string, and its length.If the two strings being concatenated are too long their lengths combined are longer than the length of the destination return Otherwise, concatenate the second string to the end of the first string with a space character in between them.Then return
Hint: you may want to use movsb but point one of the two registers somewhere other than the start of a string.
Create a procedure named ToLowerCase which takes a string's offset and its size as parameters in a stack frame. This procedure should update the incoming string so that each character is lowercase.
Hint: Refer to lecture for help on how to convert a character to lowercase.
Create a procedure named DisplayLetterCount which takes a string's offset and its size as parameters in a stack frame. This procedure should display how many times each letter appears in the incoming string. To write this procedure, do the following:
Convert the incoming string to lowercase by calling ToLowerCase.In a nested loop, loop over the characters in the lowercase string times, once for each letter of the alphabet. In the inner loop, count how many times the current letter appears in the name. After the inner loop but before the next iteration of the outer loop display the letter if it appears at least once and how many times it appears.
Hint : The lowercase letters have ascii codes from In first iteration of the outer loop, see if any character in the string equals without quotes That will tell you how many a characters there are.Hint : When printing how many times a letter appears, print the letter first followed by the count. Recall that to print a letter with the Irvine library, we move its ascii code to AL and then call WriteChar.
When the user begins the program, ask for their first name and place it in one string variable. Then, ask for their last name and place it in another string variable. Pass both to the StringConcat procedure.
If the procedure returns print an error message and end the program.Otherwise, print a welcome message including the user's concatenated full name.
Next, pass the user's name to the DisplayLetterCount procedure, which should display how many times each letter appears in their name.
Make sure that each procedure you write properly preserves any registers other than eax and properly cleans up the stack!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
