Write an assembly language program that collects a string from the user then counts and displays the number of alphabets
Posted: Sat Nov 27, 2021 10:28 am
Write an assembly language program that collects a string from the user then counts and displays the number of alphabets (characters range: a to z or A to Z), the number of digits (character range: 0 to 9) and number of any other characters which are not alphabets or digits. For example, below are examples of input/output. input string: abc number of alphabets: 3 number of digits: 0 other characters: 0 input string: abc123 number of alphabets: 3 number of digits: 3 other characters: 0 input string: abc, 123 number of alphabets: 3 number of digits: 3 other characters: 1 input string: a*2 number of alphabets: 1 number of digits: 1 other characters: 1 input string: number of alphabets: 0 number of digits: other characters: ооо input string: Abco? number of alphabets: 3 number of digits: 1 other characters: 1 Use the following procedures for input/output. For more details about these procedures see Chapter 5 of Irvine textbook. • ReadString: Reads a string from the keyboard and returns its length in the EAX register. • WriteString: Writes a null-terminated string to the console window. HINT: Use the ASCII numerical code to find if a character is alphabet, digit or other character. For instance, the letter 'a' is 97, digit 'O' is 48, ..etc. For the complete ASCII table, check the following: