马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code,DS:data,SS:stack
data 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,[si]
CMP AL,0 ;等于0跳出循环
JE jies
CMP AL,61h ;是不是小于a
JB OK
CMP AL,7Ah ;是不是大于z
JA OK
AND al,1011111B ;将小写转换大写
MOV [si],AL
OK:INC SI
JMP S
jies:
POP SI
POP AX
RET
code ends
end start
|