Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- asm.o: file format elf64-x86-64
- Disassembly of section .text:
- 0000000000000000 <add>:
- 0: 55 push %rbp # push old base pointer from higher level function
- 1: 48 89 e5 mov %rsp,%rbp # set stack pointer to this as well
- 4: 89 7d fc mov %edi,-0x4(%rbp) # by convention, set edi = arg 1
- 7: 89 75 f8 mov %esi,-0x8(%rbp) # set esi = arg 2 (UNUSED BUT AUTO-GENERATED BECAUSE OF CONVENTION)
- a: 8b 55 fc mov -0x4(%rbp),%edx # edx = arg 1 (p1)
- d: 8b 45 f8 mov -0x8(%rbp),%eax # eax = arg 2 (p2)
- 10: 01 d0 add %edx,%eax # eax = p1 + p2
- 12: 5d pop %rbp # restore base pointer for higher level function
- 13: c3 retq
- 0000000000000014 <main>:
- 14: 55 push %rbp
- 15: 48 89 e5 mov %rsp,%rbp
- 18: 48 83 ec 10 sub $0x10,%rsp
- 1c: c7 45 f0 05 00 00 00 movl $0x5,-0x10(%rbp)
- 23: c7 45 f4 06 00 00 00 movl $0x6,-0xc(%rbp)
- 2a: c7 45 f8 07 00 00 00 movl $0x7,-0x8(%rbp)
- 31: 8b 55 f8 mov -0x8(%rbp),%edx
- 34: 8b 45 f0 mov -0x10(%rbp),%eax
- 37: 89 d6 mov %edx,%esi
- 39: 89 c7 mov %eax,%edi
- 3b: e8 00 00 00 00 callq 40 <main+0x2c>
- 3c: R_X86_64_PC32 add-0x4
- 40: 89 45 fc mov %eax,-0x4(%rbp)
- 43: 8b 45 fc mov -0x4(%rbp),%eax
- 46: 89 c6 mov %eax,%esi
- 48: 48 8d 3d 00 00 00 00 lea 0x0(%rip),%rdi # 4f <main+0x3b>
- 4b: R_X86_64_PC32 .rodata-0x4
- 4f: b8 00 00 00 00 mov $0x0,%eax
- 54: e8 00 00 00 00 callq 59 <main+0x45>
- 55: R_X86_64_PLT32 printf-0x4
- 59: b8 00 00 00 00 mov $0x0,%eax
- 5e: c9 leaveq
- 5f: c3 retq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement