用汇编语言帮忙编个程序

来源:百度知道 编辑:UC知道 时间:2024/06/07 18:53:36
将一个字符串中的小写字母转换成大写字母,不用键盘输入字符串
比如,aBC1def,转换成ABC1DEF
谢谢

push esi
push eax
push ecx
xor eax,eax
xor ecx,ecx
mov esi,offset yourstring
FLAG2:
mov al,[esi+ecx]
test eax,eax ;检测是否到字符串的终点
jz FLAG_end
cmp al,'a' ;判断是否为小写字符
jb FLAG1
cmp al,'z'
ja FLAG1
sub byte ptr [esi+ecx],32
FLAG1:
inc ecx
jmp FLAG2
FLAG_end:
pop ecx
pop eax
pop esi