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 character 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
Note: The mReadStr macro causes a call to this procedure.
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)