int p1(int x,int y)
{
return x+y;
}
int main(void)
{
int x,y,z;
x=1;
y=2;
z=p1(x,y);
}
反汇编
main
{.
.
80484b4: c7 45 fc 01 00 00 00 movl $0x1,0xfffffffc(%ebp)
80484bb: c7 45 f8 02 00 00 00 movl $0x2,0xfffffff8(%ebp)
80484c2: ff 75 f8 pushl 0xfffffff8(%ebp)
80484c5: ff 75 fc pushl 0xfffffffc(%ebp)
80484c8: e8 bf ff ff ff call 804848c <p1>
.
.
}
0804848c <p1> :
804848c: 55 push %ebp
804848d: 89 e5 mov %esp,%ebp
804848f: 8b 45 0c mov 0xc(%ebp),%eax
8048492: 03 45 08 add 0x8(%ebp),%eax
8048495: c9 leave
8048496: c3 ret
8048497: 90 nop
谁能给解释一下0xfffffffc(%ebp)是什么意思?
------解决方案--------------------------------------------------------
call 指令不将 cs 压栈的, 这里都是 near 类型的, 不是 far 类的调用
------解决方案--------------------------------------------------------
call far ptr 标号(实现段间转移)相当于: