ReadString (from Irvine32 Library) The ReadString procedure reads a string from the keyboard, stopping when the user presses the Enter key. Pass the offset of a buffer in EDX and set ECX to the maximum number of characters the user can enter, plus 1 (to save space for the terminating null byte). The procedure returns the count of the number of characters typed by the user in EAX. Sample call: .data buffer BYTE 21 DUP(0)      ; input buffer byteCount DWORD ?          ; holds counter remrk byte “Enter a string: “,0 .code main proc mov edx,OFFSET buffer      ; point to the buffer mov ecx,SIZEOF buffer      ; specify max characters call ReadString            ; input the string mov byteCount,eax          ; number of characters ReadString automatically inserts a null terminator in memory at the end of the string. The following is a hexadecimal and ASCII dump of the first 8 bytes of buffer after the user has entered the string “ABCDEFG".  The variable byteCount equals 7.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 4.4CP
icon
Related questions
Question

ReadString (from Irvine32 Library) The ReadString procedure reads a string from the keyboard, stopping when the user presses the Enter key. Pass the offset of a buffer in EDX and set ECX to the maximum number of characters the user can enter, plus 1 (to save space for the terminating null byte). The procedure returns the count of the number of characters typed by the user in EAX. Sample call:

.data

buffer BYTE 21 DUP(0)      ; input buffer

byteCount DWORD ?          ; holds counter

remrk byte “Enter a string: “,0

.code

main proc

mov edx,OFFSET buffer      ; point to the buffer

mov ecx,SIZEOF buffer      ; specify max characters

call ReadString            ; input the string

mov byteCount,eax          ; number of characters

ReadString automatically inserts a null terminator in memory at the end of the string. The following is a hexadecimal and ASCII dump of the first 8 bytes of buffer after the user has entered the string “ABCDEFG".  The variable byteCount equals 7.

Get a string from a user using ReadString procedure. Your output should be shown as below.

C:4.
CAWindows\system32\cmd.exe
Please insert a string: Towson_university
Towson_university
ytisrevinu_noswot
Press any key to continue .
Transcribed Image Text:C:4. CAWindows\system32\cmd.exe Please insert a string: Towson_university Towson_university ytisrevinu_noswot Press any key to continue .
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output 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
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage