.model small .stack 100h .data buffer db 20 ; Max length db 0 ; Actual length (filled in by DOS) db 20 dup(?) ; The actual input string .code mov ax, @data mov ds, ax mov ah, 0Ah ; DOS function: buffered input lea dx, buffer ; Load address of buffer int 21h ; Call DOS to get the string ; Now, buffer+2 points to the start of the actual string ; buffer+1 tells you how many characters were read mov ah, 4Ch ; Exit program int 21h end