Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* C code, which should return 250000 but returns 16 */
- void test()
- {
- int ret = pow(500,2);
- printf("500^2 is %d\n", ret);
- return ret;
- }
- /* ASM code, which returns printf()'s return value */
- 800026e4 <test>:
- 800026e4: 83 ec 1c sub $0x1c,%esp
- 800026e7: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
- 800026ee: 00
- 800026ef: c7 04 24 f4 01 00 00 movl $0x1f4,(%esp)
- 800026f6: e8 1f 29 00 00 call 8000501a <pow>
- 800026fb: 89 44 24 04 mov %eax,0x4(%esp)
- 800026ff: c7 04 24 80 75 00 80 movl $0x80007580,(%esp)
- 80002706: e8 c8 2f 00 00 call 800056d3 <printf>
- 8000270b: 83 c4 1c add $0x1c,%esp
- 8000270e: c3 ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement