c语言函数调用分析,C语言函数调用分析

...

8048393: c3 ret

08048394 :

#include

int pluss_a_and_b(int a,int b)

{

8048394: 55 push %ebp

8048395: 89 e5 mov %esp,%ebp

8048397: 83 ec 10 sub $0x10,%esp

int c = -2;

804839a: c7 45 fc fe ff ff ff movl $0xfffffffe,-0x4(%ebp)

return (a + b - c);

80483a1: 8b 45 0c mov 0xc(%ebp),%eax

80483a4: 8b 55 08 mov 0x8(%ebp),%edx

80483a7: 8d 04 02 lea (%edx,%eax,1),%eax

80483aa: 2b 45 fc sub -0x4(%ebp),%eax

}

80483ad: c9 leave

80483ae: c3 ret

080483af :

intcall_plus(int *a,int *b)

{

80483af: 55 push %ebp

80483b0: 89 e5 mov %esp,%ebp

80483b2: 83 ec 18 sub $0x18,%esp

int c = *a;

80483b5: 8b 45 08 mov 0x8(%ebp),%eax

80483b8: 8b 00 mov (%eax),%eax

80483ba: 89 45 fc mov %eax,-0x4(%ebp)

int d = *b;

80483bd: 8b 45 0c mov 0xc(%ebp),%eax

80483c0: 8b 00 mov (%eax),%eax

80483c2: 89 45 f8 mov %eax,-0x8(%ebp)

*a = d;

80483c5: 8b 45 08 mov 0x8(%ebp),%eax

80483c8: 8b 55 f8 mov -0x8(%ebp),%edx

80483cb: 89 10 mov %edx,(%eax)

*b = c;

80483cd: 8b 45 0c mov 0xc(%ebp),%eax

80483d0: 8b 55 fc mov -0x4(%ebp),%edx

80483d3: 89 10 mov %edx,(%eax)

return pluss_a_and_b(c,d);

80483d5: 8b 45 f8 mov -0x8(%ebp),%eax

80483d8: 89 44 24 04 mov %eax,0x4(%esp)

80483dc: 8b 45 fc mov -0x4(%ebp),%eax

80483df: 89 04 24 mov %eax,(%esp)

80483e2: e8 ad ff ff ff call 8048394

}

80483e7: c9 leave

80483e8: c3 ret

080483e9 :

int main()

{

80483e9: 55 push %ebp

80483ea: 89 e5 mov %esp,%ebp

80483ec: 83 ec 18 sub $0x18,%esp

int c = 10;

80483ef: c7 45 f8 0a 00 00 00 movl $0xa,-0x8(%ebp)

int d = 20;

80483f6: c7 45 f4 14 00 00 00 movl $0x14,-0xc(%ebp)

int g =call_plus(&c,&d);

80483fd: 8d 45 f4 lea -0xc(%ebp),%eax

8048400: 89 44 24 04 mov %eax,0x4(%esp)

8048404: 8d 45 f8 lea -0x8(%ebp),%eax

8048407: 89 04 24 mov %eax,(%esp)

804840a: e8 a0 ff ff ff call 80483af

804840f: 89 45 fc mov %eax,-0x4(%ebp)

return 0;

8048412: b8 00 00 00 00 mov $0x0,%eax

}

8048417: c9 leave

8048418: c3 ret

8048419: 90 nop

804841a: 90nop

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值