Skip to content

Instantly share code, notes, and snippets.

@vadixidav
Created December 2, 2016 04:01
Show Gist options
  • Select an option

  • Save vadixidav/bcf22846a9850adca591a25b5f8433bc to your computer and use it in GitHub Desktop.

Select an option

Save vadixidav/bcf22846a9850adca591a25b5f8433bc to your computer and use it in GitHub Desktop.
0000000000400554 <divide>:
400554: 55 push rbp
400555: 48 89 e5 mov rbp,rsp
400558: 48 83 ec 20 sub rsp,0x20
40055c: 89 7d ec mov DWORD PTR [rbp-0x14],edi
40055f: 89 75 e8 mov DWORD PTR [rbp-0x18],esi
400562: 83 7d e8 00 cmp DWORD PTR [rbp-0x18],0x0
400566: 75 0a jne 400572 <divide+0x1e>
400568: b8 00 00 00 00 mov eax,0x0
40056d: e8 d4 ff ff ff call 400546 <divide_zero_error>
400572: c7 45 f0 00 00 00 00 mov DWORD PTR [rbp-0x10],0x0
400579: c7 45 f4 00 00 00 00 mov DWORD PTR [rbp-0xc],0x0
400580: c7 45 fc 1f 00 00 00 mov DWORD PTR [rbp-0x4],0x1f
400587: eb 4a jmp 4005d3 <divide+0x7f>
400589: 8b 45 f4 mov eax,DWORD PTR [rbp-0xc]
40058c: 01 c0 add eax,eax
40058e: 89 45 f4 mov DWORD PTR [rbp-0xc],eax
400591: 8b 55 f4 mov edx,DWORD PTR [rbp-0xc]
400594: 8b 45 fc mov eax,DWORD PTR [rbp-0x4]
400597: 8b 75 ec mov esi,DWORD PTR [rbp-0x14]
40059a: 89 c1 mov ecx,eax
40059c: d3 ee shr esi,cl
40059e: 89 f0 mov eax,esi
4005a0: 83 e0 01 and eax,0x1
4005a3: 09 d0 or eax,edx
4005a5: 89 45 f4 mov DWORD PTR [rbp-0xc],eax
4005a8: 8b 45 f4 mov eax,DWORD PTR [rbp-0xc]
4005ab: 3b 45 e8 cmp eax,DWORD PTR [rbp-0x18]
4005ae: 72 1f jb 4005cf <divide+0x7b>
4005b0: 8b 45 f4 mov eax,DWORD PTR [rbp-0xc]
4005b3: 2b 45 e8 sub eax,DWORD PTR [rbp-0x18]
4005b6: 89 45 f4 mov DWORD PTR [rbp-0xc],eax
4005b9: 8b 55 f0 mov edx,DWORD PTR [rbp-0x10]
4005bc: 8b 45 fc mov eax,DWORD PTR [rbp-0x4]
4005bf: be 01 00 00 00 mov esi,0x1
4005c4: 89 c1 mov ecx,eax
4005c6: d3 e6 shl esi,cl
4005c8: 89 f0 mov eax,esi
4005ca: 09 d0 or eax,edx
4005cc: 89 45 f0 mov DWORD PTR [rbp-0x10],eax
4005cf: 83 6d fc 01 sub DWORD PTR [rbp-0x4],0x1
4005d3: 83 7d fc 00 cmp DWORD PTR [rbp-0x4],0x0
4005d7: 79 b0 jns 400589 <divide+0x35>
4005d9: 48 8b 45 f0 mov rax,QWORD PTR [rbp-0x10]
4005dd: c9 leave
4005de: c3 ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment