SHARE
TWEET

x86 gcc → From my compiler.

a guest Apr 30th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; x86 gcc → From my compiler.
  2.  
  3. power(int, unsigned int):
  4.         push    rbp
  5.         mov     rbp, rsp
  6.         push    rbx
  7.         sub     rsp, 24
  8.         mov     DWORD PTR [rbp-20], edi
  9.         mov     DWORD PTR [rbp-24], esi
  10.         cmp     DWORD PTR [rbp-24], 0
  11.         jne     .L2
  12.         mov     eax, 1
  13.         jmp     .L3
  14. .L2:
  15.         mov     eax, DWORD PTR [rbp-24]
  16.         and     eax, 1
  17.         test    eax, eax
  18.         jne     .L4
  19.         mov     eax, DWORD PTR [rbp-24]
  20.         shr     eax
  21.         mov     edx, eax
  22.         mov     eax, DWORD PTR [rbp-20]
  23.         mov     esi, edx
  24.         mov     edi, eax
  25.         call    power(int, unsigned int)
  26.         mov     ebx, eax
  27.         mov     eax, DWORD PTR [rbp-24]
  28.         shr     eax
  29.         mov     edx, eax
  30.         mov     eax, DWORD PTR [rbp-20]
  31.         mov     esi, edx
  32.         mov     edi, eax
  33.         call    power(int, unsigned int)
  34.         imul    eax, ebx
  35.         jmp     .L3
  36. .L4:
  37.         mov     eax, DWORD PTR [rbp-24]
  38.         shr     eax
  39.         mov     edx, eax
  40.         mov     eax, DWORD PTR [rbp-20]
  41.         mov     esi, edx
  42.         mov     edi, eax
  43.         call    power(int, unsigned int)
  44.         imul    eax, DWORD PTR [rbp-20]
  45.         mov     ebx, eax
  46.         mov     eax, DWORD PTR [rbp-24]
  47.         shr     eax
  48.         mov     edx, eax
  49.         mov     eax, DWORD PTR [rbp-20]
  50.         mov     esi, edx
  51.         mov     edi, eax
  52.         call    power(int, unsigned int)
  53.         imul    eax, ebx
  54. .L3:
  55.         add     rsp, 24
  56.         pop     rbx
  57.         pop     rbp
  58.         ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top