I’m doing an inline assembly coding with Microsoft Visual C++ 2010 Express.
I have this kind of code. The main point is I need to access each single character of an array of character. Below is just an not that relevant example, when it reach the end of the string (the terminating null character) it will jump to finish or else it will separate each character of the string with a new line.
line[10] = "I am Kevin";
format[] = "%c\n";
_asm {
mov ebx,0
loop:
cmp line[ebx],0
jz finish
mov eax, line[ebx]
push eax
lea eax, format
push eax
call printf
jmp loop
finish:
....
}
Somehow I keep having error for this line:
mov eax, line[ebx]
It kept on saying error C2443: operand size conflict
“
eax” describes 32 bits of registera.The low 8 bits of register
aisal. This will move 8 bits: