Problem Write an assembly program that prompts the user to enter a string of a size that does not exceed 20 characters and store it into a data variable wordListA using Irvine library's ReadString procedure. The program then displays the string entered by the user in reverse as shown in the sample run below.

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

Solve it by assembly masm32

Problem
Write an assembly program that prompts the user to enter a string of a size that does not exceed
20 characters and store it into a data variable wordListA using Irvine library's ReadString
procedure. The program then displays the string entered by the user in reverse as shown in the
sample run below.
Sample Run
> reverse.exe
Enter a string (max 20 characters): word
The reverse is: drow
reverse.exe
Enter a string (max 20 characters): BaB
The reverse is: BaB
> reverse.exe
Enter a string (max 20 characters): sultan
The reverse is: natlus
> reverse.exe
Enter a string (max 20 characters): abc123
The reverse is: 321cba
> reverse.exe
Enter a string (max 20 characters): &5%1772js
The reverse is: sj2771%5&
Your program must define and use the following procedure:
Procedure reverseString: this procedure reverses the string that was read from the
user by copying the characters from the defined data variable wordListA into wordListB
starting from position at length-1 of wordListA and position zero of wordListB in
reverse order (NOTE: the last character of a string is the NULL terminator at the last position
since every string must be terminated with 0 and therefore start copying from length-1). It then
completes the last position of wordListB by filling it with a NULL terminator (i.e. 0). For
instance, see the illustration below using the string “ABCD" of length=4:
wordListA = “ABCD"
position
1
2 3 4
character A
BCD0
wordListB= “DCBA"
position
1
4
character| D C BA0
Grading Table
Points
Mark
Style (naming, comments, spacing, indentation)
Data Segment with needed variables
Main Procedure (prompt=2, readstring=3, result messages=2, calling
procedure=3)
reverseString Procedure (loop=2,indexing=3,handle string null
terminator=3, return from procedure=2)
5
5
10
10
Total
30
Needed Irvine32 Library Procedures
Crlf: advances the cursor to the beginning of the next line in the console window.
ReadString: Reads a string from the keyboard.
WriteChar: writes a single character to the console window. Pass the character in AL
WriteString: writes a null-terminated string to the console window. Pass the string's offset in EDX.
Transcribed Image Text:Problem Write an assembly program that prompts the user to enter a string of a size that does not exceed 20 characters and store it into a data variable wordListA using Irvine library's ReadString procedure. The program then displays the string entered by the user in reverse as shown in the sample run below. Sample Run > reverse.exe Enter a string (max 20 characters): word The reverse is: drow reverse.exe Enter a string (max 20 characters): BaB The reverse is: BaB > reverse.exe Enter a string (max 20 characters): sultan The reverse is: natlus > reverse.exe Enter a string (max 20 characters): abc123 The reverse is: 321cba > reverse.exe Enter a string (max 20 characters): &5%1772js The reverse is: sj2771%5& Your program must define and use the following procedure: Procedure reverseString: this procedure reverses the string that was read from the user by copying the characters from the defined data variable wordListA into wordListB starting from position at length-1 of wordListA and position zero of wordListB in reverse order (NOTE: the last character of a string is the NULL terminator at the last position since every string must be terminated with 0 and therefore start copying from length-1). It then completes the last position of wordListB by filling it with a NULL terminator (i.e. 0). For instance, see the illustration below using the string “ABCD" of length=4: wordListA = “ABCD" position 1 2 3 4 character A BCD0 wordListB= “DCBA" position 1 4 character| D C BA0 Grading Table Points Mark Style (naming, comments, spacing, indentation) Data Segment with needed variables Main Procedure (prompt=2, readstring=3, result messages=2, calling procedure=3) reverseString Procedure (loop=2,indexing=3,handle string null terminator=3, return from procedure=2) 5 5 10 10 Total 30 Needed Irvine32 Library Procedures Crlf: advances the cursor to the beginning of the next line in the console window. ReadString: Reads a string from the keyboard. WriteChar: writes a single character to the console window. Pass the character in AL WriteString: writes a null-terminated string to the console window. Pass the string's offset in EDX.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Embedded software development
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.
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