Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 3.59 KB | None | 0 0
  1.         .text
  2.         .global mul64p
  3. mul64p:
  4.         push    %ebp
  5.         mov     %esp,   %ebp
  6.         push    %edi
  7.         push    %esi
  8.         push    %ebx
  9.  
  10.         //fourth part
  11.         movl    $0,        %ebx
  12.         movl    8(%ebp),   %esi
  13.         movl    16(%ebp),  %eax
  14.         movl    $0,        %edx
  15.         mull    %esi
  16.         movl    %eax,      a
  17.  
  18.         //third part
  19.         movl    $0,        %edi
  20.         movl    8(%ebp),   %esi
  21.         movl    16(%ebp),  %eax
  22.         movl    $0,        %edx
  23.         mull    %esi
  24.         addl    %edx,      %edi
  25.         adc     $0,        %ebx
  26.  
  27.         movl    12(%ebp),  %esi
  28.         movl    16(%ebp),  %eax
  29.         movl    $0,        %edx
  30.         mull    %esi
  31.         add     %eax,      %edi
  32.         adc     $0,        %ebx
  33.  
  34.         movl    8(%ebp),   %esi
  35.         movl    20(%ebp),  %eax
  36.         movl    $0,        %edx
  37.         mull    %esi
  38.         addl    %eax,      %edi
  39.         adc     $0,        %ebx
  40.         movl    %edi,      b
  41.         //second part
  42.         movl    $0,        %edi
  43.         movl    12(%ebp),  %esi
  44.         movl    20(%ebp),  %eax
  45.         movl    $0,        %edx
  46.         mull    %esi
  47.         movl    $0,        %ecx
  48.         addl    %eax,      %edi
  49.         addl    %ebx,      %edi
  50.         adc     $0,        %ecx
  51.         movl    $0,        %ebx
  52.         movl    %ecx,      %ebx
  53.  
  54.         movl    12(%ebp),  %esi
  55.         movl    16(%ebp),  %eax
  56.         movl    $0,        %edx
  57.         mull    %esi
  58.         add     %edx,      %edi
  59.         adc     $0,        %ebx
  60.  
  61.         movl    8(%ebp),   %esi
  62.         movl    20(%ebp),  %eax
  63.         movl    $0,        %edx
  64.         mull    %esi
  65.         addl    %edx,      %edi
  66.         adc     $0,        %ebx
  67.         movl    %edi,      c
  68.  
  69.         //fist part
  70.         movl    12(%ebp),  %esi
  71.         movl    20(%ebp),  %eax
  72.         movl    $0,        %edx
  73.         mull    %esi
  74.         addl    %ebx,      %edx
  75.         movl    %edx,      d
  76.         //writeResults
  77.  
  78.         movl    $0,       %ebx
  79.         movl    d,        %eax
  80.         testl   %eax,     %eax
  81.         jz      NWF
  82.         movl    $1,       %ebx
  83.         push    %eax
  84.         push    $L
  85.         call    printf
  86. NWF:
  87.         movl    c,        %eax
  88.         testl   %ebx,     %ebx
  89.         jnz     WFS
  90.         testl   %eax,     %eax
  91.         jnz     WS
  92.         jmp     NWS
  93. WFS:
  94.         push    %eax
  95.         push    $8
  96.         push    $FL
  97.         call    printf
  98.         jmp     NWS
  99. WS:
  100.         movl    $1,       %ebx
  101.         push    %eax
  102.         push    $L
  103.         call    printf
  104. NWS:
  105.         movl    b,        %eax
  106.         testl   %ebx,     %ebx
  107.         jnz     WFT
  108.         testl   %eax,     %eax
  109.         jnz     WT
  110.         jmp     NWT
  111. WFT:
  112.         push    %eax
  113.         push    $8
  114.         push    $FL
  115.         call    printf
  116.         jmp     NWT
  117. WT:
  118.         movl    $1,       %ebx
  119.         push    %eax
  120.         push    $L
  121.         call    printf
  122.  
  123. NWT:
  124.         movl    a,        %eax
  125.         testl   %ebx,     %ebx
  126.         jnz     WF
  127.         push    %eax
  128.         push    $NL
  129.         call    printf
  130.         jmp     END
  131. WF:
  132.         push    %eax
  133.         push    $8
  134.         push    $NFL
  135.         call    printf
  136.         jmp     END
  137. END:
  138.  
  139.         movl    %ebp,    %esp
  140.         movl    -12(%ebp), %ebx
  141.         movl    -8(%ebp),  %esi
  142.         movl    -4(%ebp),  %edi
  143.         pop     %ebp
  144.         ret
  145. L:      .asciz  "%x"
  146. FL:     .asciz  "%0*x"
  147. NL:     .asciz  "%x\n"
  148. NFL:    .asciz  "%0*x\n"
  149.         .data
  150. a:      .int    0
  151. b:      .int    0
  152. c:      .int    0
  153. d:      .int    0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement