Question: Question 4 ( 1 5 % ) : Write a program that defines a byte array, called String 1 , with a size of 1
Question : Write a program that defines a byte array, called String with a size of bytes. ReadString PROC
Reads a string of up to ECX nonnull characters from standard input, stopping when the user presses the Enter key.
A null byte is stored following the characters input, but the trailing carriage return and line feed characters are not placed into the buffer.
ECX should always be smaller than the buffer size never equal to the buffer size because the null byte could be the ECX th characte
stored.
Call args: EDX points to the input buffer
ECX max number of nonnull chars to read
Return arg: EAX size of input string.
Example:
data
MAX ;max chars to read
stringIn BYTE MAX DUP ;room for null
code
mov edx,OFFSET stringIn
mov ecx,MAX ;buffer size
call ReadString
The program should read a string from the keyboard all characters are small letters, and the maximum
number of characters is using the Irvine ReadString procedure and store the string in String The
program should capitalize the first three letters of the string and print the modified string using the
Irvine WriteString. You need to use the "directoffset operand" address mode Topic part to
answer this question. Below please find a sample of the expect output of the program.
Hint: below is the explanation of the ReadString procedure.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
