不正确的操作数类型的含义是什么?使用__asm不正确的操作数类型错误
我想一些C++代码转换成汇编
temp_char = OChar[i] //temp_char is a character and OChar is array and i is the index
香港专业教育学院试图
mov eax, i
mov temp_char, [eax+OChar]
也
mov eax, i
movsx temp_char, [eax+OChar]
任何人都可以解释我怎么能避免不当操作类型?
这是完整的代码
char temp_char;
int i;
__asm{
mov i,0
jmp checkend
startfor: mov eax,i
add eax,1
mov i,eax
checkend: cmp i,length
jge endloop
movsx temp_char, [eax+OChars]
//encryption of string//
push eax
and eax,0xAA
not al
mov edx,eax
pop eax
and eax,0x55
xor ecx,edx
xor ecx,eax
rol cl,2
sub al,0x20
pop ebp
//end of encryption//
movsx [eax+EChars], temp_char
jmp startfor
endloop: ret
}
什么你是否正在尝试**?哪一行出现该错误? – 2013-05-06 20:16:53
mov temp_char,[eax + OChars] – 2013-05-06 20:23:52
您正尝试将数组移入寄存器。那不是bueno。 – inetknght 2013-05-06 20:24:50