Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         .section    .rodata
  2. format_out:
  3.         .string    "%lu\n"
  4.  
  5.         .data
  6. A:      .int    0
  7. B:      .int    0
  8.  
  9.         .text
  10.         .global A, B, process
  11. process:
  12.         pushl   %ebp
  13.         movl    %esp, %ebp
  14.         pushl   %ebx
  15.         pushl   %esi
  16.         pushl   %edi
  17.  
  18.         leal    A,  %ebx
  19.         movl    (%ebx), %ecx
  20.         movl    4(%ebx), %edx
  21.  
  22.         shl     $1, %edx
  23.         shl     $1, %ecx
  24.         adcl    $0, %edx
  25.  
  26.         leal    B,  %ebx
  27.         movl    (%ebx), %esi
  28.         movl    4(%ebx), %edi
  29.  
  30.         movl    %edi, %ebx
  31.         andl    $1, %ebx
  32.         shl     $31, %ebx
  33.  
  34.         shr     $1, %esi
  35.         shr     $1, %edi
  36.         addl    %ebx, %esi
  37.  
  38.         subl    %esi, %ecx
  39.         sbbl    %edi, %edx
  40.  
  41.         pushl   %edx
  42.         pushl   %ecx
  43.         pushl   $format_out
  44.         call    printf
  45.         addl    $12, %esp
  46.  
  47.         popl    %edi
  48.         popl    %esi
  49.         popl    %ebx
  50.         movl    %ebp, %esp
  51.         popl    %ebp
  52.         ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement