# 实验11
编写一个子程序,将包含任意字符,以0结尾的字符串中的小写字母转变成大写字母,描述如下。
名称:letterc
功能:将以0结尾的字符串中的小写字母转变成大写字母
参数:ds:si指向字符串首地址
应用举例:
```assembly
assume cs:codesg
datasg segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends
codesg segment
begin: mov ax, datasg
mov ds, ax
mov si, 0
call letterc
mov ax, 4c00H
int 21H
letterc: ????????
????????
codesg ends
end begin
```
答:
```assembly
assume cs:codesg
datasg segment
db"Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends
codesg segment
start:
mov ax,datasg
mov ds,ax
mov si,0
call letterc
mov ax,4c00h
int 21h
letterc:
mov al,[si]
cmp al,0
je over
cmp al,'a'
jb skip
cmp al,'z'
ja skip
and al,11011111b
mov [si],al
skip:
inc si
jmp letterc
over:
ret
codesg ends
end start
```
标签:11,mov,al,datasg,codesg,letterc,ax,实验 From: https://www.cnblogs.com/alphadoiy/p/17571894.html