Advertisement
pasholnahuy

Untitled

Oct 7th, 2023
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.70 KB | None | 0 0
  1. 1 .global main
  2. 2. superum:
  3. 3. xor %edx, %edx
  4. 4. cmp %esi, %edi
  5. 5. jle swap
  6. 6 push %ebx
  7. 7 mov $-1, %ebx
  8. 8 jmp put
  9. 9
  10. 10 put:
  11. 11 xor %edx, %edx
  12. 12 inc %ebx
  13. 13 cmp %ebx, %esi
  14. 14 jle prepare_loop
  15. 15 movb (%eax, %ebx, 1), %edx 16 movb %edx, (%ecx, %ebx, 1) 17 jmp loop 18 19 prepare_loop: 20 mov $-1, %ebx 21 xor %edx, %edx 22 loop: 23 inc %ebx 24 cmp %ebx, %edi 25 jg add_remain 26 addw (%ecx, %ebx, 1), %dx 27 addw (%eax, %ebx, 1), %dx 28 mov %dl, (%ecx, %ebx, 1) 29 mov %dh, %dl 30 xor %dh, %dh 31 jmp loop 32 33 swap: 34 xchg %eax, %ebx 35 xchg %esi, %edi 36 jmp supersum 37 38 add_remain: 39 addw (%ecx, %ebx, 1), %dx 40 mov %dl, (%ecx, %ebx, 1) 41 mov %dh, %dl 42 xor %dh, %dh 43 cmp $0, %dl 44 jnz loop 45 46 call_ret: 47 mov (%esp), %ebx 48 ret 49
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement