Write assembly program

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write assembly program

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 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY