我被这个问题困住了。我正在自学汇编程序并翻译一些基本指令。但我不能用这个。
谁能帮帮我吗?
int
secuencia ( int n, EXPRESION * * o )
{
int a, i;
for ( i = 0; i < n; i++ ){
a = evaluarExpresion( *o );
// Im trying to do this: o++;
__asm {
mov eax,dword ptr [o]
mov ecx,dword ptr [eax]
inc [ecx]
}
}
return a ;
}
我写了里面的 and 工作,但仍然不知道如何增加 O
int
secuencia ( int n, EXPRESION * * o )
{
int a, i;
for ( i = 0; i < n; i++ ){
__asm {
mov eax,dword ptr [o]
mov ecx,dword ptr [eax]
push ebp
mov ebp, esp
push ecx
call evaluarExpresion
mov esp, ebp
pop ebp
mov a, eax
}
o++;
}
return a ;
}
最佳答案
mov esi, o
add esi, 4 //increment is here
第 1 行:我们将 o 指针移至 esi 寄存器。 Line2:我们增加你的 o 指针
或
mov eax, o
mov esi, [eax]
add esi, 4
我不太明白你想做什么,但希望对你有帮助!
关于c - 汇编器中的简单增量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1695472/