编写一个子程序:将包含任意字符,以0结尾的字符串中的小写字母转变成大写字母
assume cs:code,ds:data
data segment
db 'Beginners All-purpose Symbolic Instruction Code.',0
data ends
code segment
begin:
mov ax,data
mov ds,ax
mov si,0
call letterc
mov ah,4ch
int 21h
letterc:
push ax
s:
mov al,[si]
mov ah,0
mov cx,ax
jcxz return
cmp al,61h
jb next
cmp al,91h
ja next
and al,11011111b
mov [si],al
next:
inc si
jmp short s
return:
pop ax
ret
code ends
end begin
网友评论