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&
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
![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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F35724429-d859-4e1f-bcf2-5ebbd2ec2e82%2F811c893d-32e6-45f6-b1a7-d9e7c3681646%2F7lcwal_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)