只有一行代码, 编译出错了
void read_stack(int* result, int offset)
{
__asm__ (
"movl %1(%%esp), (%0)\n" : : "r"(result), "r"(offset * 4) :
);
}
void read_stack(int* result, int offset)
{
__asm__ (
"movl %%esp, %%esi\n"
"movl (%1, %%esi), %%eax\n"
"movl %%eax, (%0)\n" : : "r"(result), "r"(offset * 4) : "%esi", "eax", "memory"
);
}