Skip to content

Instantly share code, notes, and snippets.

@timofurrer
Created February 19, 2012 20:41
Show Gist options
  • Select an option

  • Save timofurrer/1865658 to your computer and use it in GitHub Desktop.

Select an option

Save timofurrer/1865658 to your computer and use it in GitHub Desktop.
Assambler code in intel flavor to print hello world 10 times in a for
00000000004004f4 <main>:
4004f4: 55 push rbp
4004f5: 48 89 e5 mov rbp,rsp
4004f8: 48 83 ec 10 sub rsp,0x10
4004fc: c7 45 fc 00 00 00 00 mov DWORD PTR [rbp-0x4],0x0
400503: eb 0e jmp 400513 <main+0x1f>
400505: bf 0c 06 40 00 mov edi,0x40060c
40050a: e8 e1 fe ff ff call 4003f0 <puts@plt>
40050f: 83 45 fc 01 add DWORD PTR [rbp-0x4],0x1
400513: 83 7d fc 09 cmp DWORD PTR [rbp-0x4],0x9
400517: 7e ec jle 400505 <main+0x11>
400519: b8 00 00 00 00 mov eax,0x0
40051e: c9 leave
40051f: c3 ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment