还可以把inc si调整一下位置,全用jmp系列指令实现循环,而不用loop
assume cs:code
data segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
data ends
code segment
start:
mov ax,data
mov ds,ax
mov si,0
call letterc
mov ax,4c00h
int 21h
letterc:
;小写转成大写
push cx
s:
mov cl,[si]
mov ch,0
jcxz ok
cmp cl,97
jb ca
cmp cl,122
ja ca
and byte ptr [si],11011111b
ca:
inc si
loop s
ok:
mov si,0
pop cx
ret
code ends
end start