分析:
利用 and 11011111b 將小寫改為大寫
子程序代碼:
letterc:
push ax
push si
s0:mov al,[si] # 將ds:[si]處的字節傳入al
cmp al,0 # 判斷是否已經到了字符串尾部
je s2 # 到尾部了跳轉到退出
mov ah,'a'
cmp al,ah
jb s1 # al中的值小于'a'對應的值則跳轉s1
mov ah,'z'
cmp al,ah
ja s1 # al中的值大于'z'對應的值則跳轉s1
and al,11011111b # 小寫轉大寫
mov [si],al # 轉換完成的值傳回
s1:inc si
jmp short s0 # 跳轉至s0
s2:pop si
pop ax
ret