title MS-DOS Function Calls - 2 (DOS2-1.ASM) ;Problem statement: ;Write a program that inputs a string using DOS ;function 0Ah. Limit the input to ten characters. ;Redisplay the string backwards INCLUDE Irvine16.inc .data COUNT = 11 keyboardArea label byte maxkeys db COUNT charsInput db ? buffer db COUNT dup(0) .code main proc mov ax,@data mov ds,ax mov ah,0Ah ; buffered keyboard input mov dx,offset keyboardArea int 21h call Crlf ; Redisplay the string backwards, using SI ; as an index into the string mov ah,0 mov al,charsInput ; get character count mov cx,ax ; put in loop counter mov si,ax ; point past end of string dec si ; back up one position L1: mov dl,buffer[si] ; get char from buffer mov ah,2 ; MS-DOS char output function int 21h dec si ; back up in buffer Loop L1 ; loop through the string call Crlf exit main endp end main