title MS-DOS Function Calls - 2 (DOS2-2.ASM) ;Problem statement: ;Write a program that inputs a string of up to 80 ;characters using DOS function 3Fh. After the input, ;display a count on the screen of the actual number ;of characters typed by the user. INCLUDE Irvine16.inc .data COUNT = 80 ; create the input buffer, and allow ; for two extra characters (CR/LF) buffer db (COUNT+2) dup(0) .code main proc mov ax,@data mov ds,ax mov ah,3Fh ; input from file or device mov bx,0 ; keyboard device handle mov cx,COUNT ; max input count mov dx,offset buffer int 21h ; call DOS to read the input ; Display the character count in AX that was ; returned by INT 21h function 3Fh ; (minus 2 for the CR/LF characters) sub ax,2 call Writedec ; display AX call Crlf exit main endp end main