从键盘输入字符串,如是 小写字母,则转为大写字母输出。如是大写字母,原样输出。并约定,键入复位键[ESC]中止输入。例:输入: deddeDEDG 按复位键[ESC] 输出:deddededg
data segment
string db 10 dup(?)
str db 10 dup(?)
data ends
code segment
assume cs:code,ds:data
main proc far
mov ax,data
mov ds,ax
mov cx,10
lea di,str
lea si,string
get: mov ah,01h
int 21h
cmp al,1bh
jz done
mov byte ptr[si],al
inc si
loop get
done:lea si,string
again:mov al,[si]
cmp al,61h
jae next
mov byte ptr[di],al
jmp next1
next:
sub al,20h
mov byte ptr[di],al
next1:inc si
inc di
loop again
lea di,str
mov ah,02h
get1:mov dl,[di]
int 21h
inc di
loop get1
call nextline
ret
main endp
nextline proc near
mov dl ,0dh
mov ah,02h
int 21h
mov dl,0ah
mov ah,02h
int 21h
ret
nextline endp
code ends
end main