将包含任意字符,以0结尾的字符串中的小写字母转变成大写字母

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:

  s:	mov ch,0
    mov cl,ds:[si]  ;先放入cl
    jcxz ok  ;检测是否为0,是则返回(为0及已经到达结尾)
    
    cmp cl,97  ;将数值放入显存
    jnb s0

  s2:	mov [si],cl
    inc si
    jmp short s

  s0:	cmp cl,122
    jna s1
    jmp short s2

  s1:	sub cl,32
    jmp s2

  ok: ret

codesg ends

end begin

3
说点什么

avatar
3 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
danisjiang Recent comment authors

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

  Subscribe  
最新 最旧 得票最多
提醒