美文网首页
汇编语言(第三版)-- 实验11

汇编语言(第三版)-- 实验11

作者: Cichar | 来源:发表于2017-03-21 11:49 被阅读0次
分析:
利用 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

相关文章

网友评论

      本文标题:汇编语言(第三版)-- 实验11

      本文链接:https://www.haomeiwen.com/subject/rwownttx.html