实验11将一串结尾0的字符中的小写改变为大写
assume cs:code,DS:data,SS:stackdata segment
DB "Beginner's All-purpose Symbolic Instruction Code.",0
data ends
stack segment
DW 8 dup(0)
stack ends
code segment
start:
MOV AX,data
MOV DS,AX
MOV AX,stack
MOV SS,AX
MOV sp,16
MOV SI,0
CALL letterc
mov ax,4c00h
int 21h
;将一串结尾为0的字符中的小写转换成大写
letterc:
PUSH AX
PUSH SI
S:MOV AL,
CMP AL,0 ;等于0跳出循环
JE jies
CMP AL,61h;是不是小于a
JB OK
CMP AL,7Ah;是不是大于z
JA OK
AND al,1011111B;将小写转换大写
MOV ,AL
OK:INC SI
JMP S
jies:
POP SI
POP AX
RET
code ends
end start
页:
[1]