我正在MASM中编写一个汇编代码,只将已经声明为大写的字符串中的小写字母转换为仅大写字母。到目前为止我有这个,但它以相反的顺序打印,我不知道为什么。另外,我正试图删除柜台,因为我不应该有一个,但没有它我的程序无法运行。任何的意见都将会有帮助!组装MASM将字符串中的char从小写更改为大写
.386
.MODEL FLAT
ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD
Include io.h
cr equ 0DH
Lf equ 0AH
.stack 4096
.data
str1 dword "aBcD",0
str1value byte "The new value of str1 is: ", 0
byte cr, Lf, 0
.code
_start:
sub esi, esi ; index reg
lea ebx, str1
top: mov al, [ebx+esi]
and al, 0DFh ;convert lowercase to corresponding uppercase
mov [esi+ebx], al
inc esi
loop top
done: output str1value
output str1
Invoke ExitProcess, 0
Public _start ; make entry point public
end ; end of source code