Advertisement
anechka_ne_plach

asssss

Dec 3rd, 2021
1,476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         .global mul2, main, value
  2. mul2:
  3.         push    %ebp
  4.         mov     %esp, %ebp
  5.  
  6.         xor     %eax, %eax
  7.         xor     %edx, %edx
  8.         mov     8(%ebp), %ecx   // address
  9.         mov     (%ecx), %eax    // value
  10.  
  11.         mov     %eax, %edx
  12.         add     %eax, %eax
  13.         jo      infty
  14.  
  15. fin:
  16.         mov     %eax, (%ecx)
  17.  
  18.         mov     %ebp, %esp
  19.         pop     %ebp
  20.         ret
  21.        
  22. infty:
  23.         mov     %edx, %eax
  24.         jmp     fin
  25.  
  26. /* main:
  27.         call    readi32
  28.         mov     %eax, value
  29.         mov     $value, %ecx
  30.         push    %ecx
  31.         call    mul2
  32.         mov     value, %eax
  33.         call    writei32
  34.         pop     %ecx
  35.         call    finish
  36.  
  37.         .data
  38. value:
  39.         .int 0 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement