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: other characters: input string: abc123 number of alphabets: 3 number of digits: other characters: input string: abc,123 number of alphabets: 3 number of digits: 3 other characters: 1 input string: a*2 number of alphabets: number of digits: 1 other characters: 1 input string: number of alphabets: 0 number of digits: other characters: input string: AbC0? number of alphabets: 3 number of digits: other characters: 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. m O O

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You have to use Irvine32 library only 

And there is sample code about the problem need to complete and write it in other shape as you can 

INCLUDE Irvine32.inc

.data

str1 BYTE 81 DUP(0) ; buffer to store the string

maxStr DWORD 81 ; maximum number of characters to read

strLen DWORD 0 ; memory to store the length of string

msg1 BYTE "Input: ",0

msg2 BYTE "The string has ",0

msg3 BYTE " characters",0

.code

main PROC

call readStr

call printResult

exit

main ENDP

readStr PROC ; show msg1 in the screen MOV EDX, OFFSET msg1

call writeString ; read from the keyboard into str1

MOV EDX, OFFSET str1 ; EDX = memory address of string buffer

MOV ECX, maxStr ; save maximum chars to read from keyboard in ECX

call readString ; call Irvine readString procedure to read string

; store string length in strLen variable

  MOV strLen, EAX

readStr ENDP 

 

printResult

PROC

MOV EDX, OFFSET msg2

call writeString

MOV EAX, strLen

call writeDec

MOV EDX, OFFSET msg3

call writeString

call crlf

call crlf

printResult

ENDP

END main

 

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:
other characters:
input string: abc123
number of alphabets: 3
number of digits:
3
other characters:
input string: abc,123
number of alphabets: 3
number of digits:
3
other characters:
1
input string: a*2
number of alphabets:
number of digits:
1
other characters:
input string:
number of alphabets:
number of digits:
other characters:
input string: AbC0?
number of alphabets: 3
number of digits:
1
other characters:
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 '0' is 48, .etc. For the complete ASCII table, check the
following: https://en.wikipedia.org/wiki/ASCII
m o o
Transcribed Image Text: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: other characters: input string: abc123 number of alphabets: 3 number of digits: 3 other characters: input string: abc,123 number of alphabets: 3 number of digits: 3 other characters: 1 input string: a*2 number of alphabets: number of digits: 1 other characters: input string: number of alphabets: number of digits: other characters: input string: AbC0? number of alphabets: 3 number of digits: 1 other characters: 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 '0' is 48, .etc. For the complete ASCII table, check the following: https://en.wikipedia.org/wiki/ASCII m o o
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education