1
你好,我有一個關於lea指令和數組的問題,這工作得很好:內聯彙編LEA與陣列
char *msg = new char[6];
msg = "hello";
_asm{
push 10h
push 0
mov eax, [msg]
push eax
push 0
call MessageBox
}
}
可是爲什麼我在這裏得到一個「操作數大小衝突」的錯誤?
char msg2[] = "hey2";
_asm{
push 10h
push 0
mov eax, [msg2]
push eax
push 0
call MessageBox
}
爲什麼它會再次與lea一起工作?
char msg2[] = "hey2";
_asm{
push 10h
push 0
lea eax, [msg2] // <-
push eax
push 0
call MessageBox
}
謝謝,我認爲這將只是MOV指針。 – Jona
'mov'指令在源和目標之間移動數據。由於大小不匹配字節<>雙字你會得到一個錯誤。 – Devolus