Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         .section        .rodata
  2. pnt_fmt_long:
  3.         .string "%llx%016llx\n"
  4. pnt_fmt:
  5.         .string "%llx\n"
  6.  
  7.         .text
  8.         .global mul64p
  9. mul64p:
  10.         pushl   %ebp
  11.         movl    %esp, %ebp
  12.  
  13.         /*movl    8(%ebp), %eax /* a2
  14.         movl    12(%ebp), %eax /* a1
  15.         movl    16(%ebp), %eax /* b2
  16.         movl    20(%ebp), %eax /* b1 */
  17.  
  18.         movl    8(%ebp), %eax
  19.         mull    16(%ebp)
  20.         movl    %eax, -4(%ebp)
  21.         movl    %edx, -8(%ebp)
  22.  
  23.         movl    $0, -12(%ebp)
  24.         movl    $0, -16(%ebp)
  25.         movl    12(%ebp), %eax
  26.         mull    16(%ebp)
  27.         addl    %eax, -8(%ebp)
  28.         adcl    %edx, -12(%ebp)
  29.  
  30.         movl    8(%ebp), %eax
  31.         mull    20(%ebp)
  32.         addl    %eax, -8(%ebp)
  33.         adcl    %edx, -12(%ebp)
  34.         adcl    $0, -16(%ebp)
  35.  
  36.         movl    12(%ebp), %eax
  37.         mull    20(%ebp)
  38.         addl    %eax, -12(%ebp)
  39.         adcl    %edx, -16(%ebp)
  40.  
  41.         cmpl    $0, -16(%ebp)
  42.         jnz     long_print
  43.         cmpl    $0, -12(%ebp)
  44.         jnz     long_print
  45.  
  46.         movl    -4(%ebp), %eax
  47.         movl    %eax, -16(%ebp)
  48.         movl    -8(%ebp), %eax
  49.         movl    %eax, -12(%ebp)
  50.        
  51.         subl    $16, %esp
  52.         pushl   $pnt_fmt
  53.         call    printf
  54.         addl    $20, %esp
  55.  
  56.         popl    %ebp
  57.         ret
  58.  
  59. long_print:
  60.         subl    $16, %esp
  61.  
  62.         movl    -12(%ebp), %eax
  63.         movl    -16(%ebp), %edx
  64.         movl    %eax, -16(%ebp)
  65.         movl    %edx, -12(%ebp)
  66.  
  67.         movl    -4(%ebp), %eax
  68.         movl    -8(%ebp), %edx
  69.         movl    %eax, -8(%ebp)
  70.         movl    %edx, -4(%ebp)
  71.  
  72.         pushl   $pnt_fmt_long
  73.         call    printf
  74.         addl    $20, %esp
  75.  
  76.         popl    %ebp
  77.         ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement