假定以下功能:访问元素在阵列与组件
void asmFunction(const int *first, ...) {
__asm {
xor eax, eax
add eax, [first][0]
; ...
}
}
它被称为是这样的:
int first[] = { 0, 0, 0, 0, 0, 0, 0, 5, 7, 6, 2, 4, 3, 5 };
asmFunction2(first, ...);
据我明白,第二流水线必须添加的0
元件阵列first
至eax
。但是,正在添加一个随机值。调试时,first[0]
等于0,因为它必须是。代码有什么问题?
我在64位机器上的Visual Studio 2013中编写代码。
我不是专家,但不应该是'add eax,[first + 0]'?用'[]'引用'第一个'指针/地址。对于元素1:'add eax,[first + 4]'等等。 – 2014-12-03 12:33:07
@意义重要性据我所知,''[first] [0]'与'[first + 0]'相同,但我不确定。 – 2014-12-03 13:26:20