Advertisement
marcelocamargo

Assembly - 1..100 Sum

Jun 8th, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.                     .globl  main
  3.                 main:
  4.                 .LFB0:
  5.                     .cfi_startproc
  6. 0000 55             pushq   %rbp
  7.                     .cfi_def_cfa_offset 16
  8.                     .cfi_offset 6, -16
  9. 0001 4889E5         movq    %rsp, %rbp
  10.                     .cfi_def_cfa_register 6
  11. 0004 C745F864       movl    $100, -8(%rbp)
  12.      000000
  13. 000b EB0A           jmp .L2
  14.                 .L3:
  15. 0013 836DF801       subl    $1, -8(%rbp)
  16. 000d 8B45F8         movl    -8(%rbp), %eax
  17. 0010 0145FC         addl    %eax, -4(%rbp)
  18.                 .L2:
  19. 0017 837DF800       cmpl    $0, -8(%rbp)
  20. 001b 7EF0           jle .L3
  21. 001d B8000000       movl    $0, %eax
  22.      00
  23. 0022 5D             popq    %rbp
  24.                     .cfi_def_cfa 7, 8
  25. 0023 C3             ret
  26.                     .cfi_endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement