Advertisement
Guest User

Untitled

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