Question: Question 4 ( 1 5 % ) : Write a program that defines a byte array, called String 1 , with a size of 1

Question 4(15%): Write a program that defines a byte array, called String1, with a size of 10 bytes. ReadString PROC
Reads a string of up to ECX non-null 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 +1)th characte
stored.
Call args: EDX points to the input buffer
ECX max number of non-null chars to read
Return arg: EAX = size of input string.
Example:
.data
MAX =80,;max chars to read
stringIn BYTE MAX+1 DUP (?) ;room for null
.code
mov edx,OFFSET stringIn
mov ecx,MAX ;buffer size -1
call ReadString
The program should read a string from the keyboard (all characters are small letters, and the maximum
number of characters is 9) using the Irvine ReadString procedure and store the string in String1. 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 "direct-offset operand" address mode (Topic 4-part 1) 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.
Question 4 ( 1 5 % ) : Write a program that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!