Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 .global main
- 2. superum:
- 3. xor %edx, %edx
- 4. cmp %esi, %edi
- 5. jle swap
- 6 push %ebx
- 7 mov $-1, %ebx
- 8 jmp put
- 9
- 10 put:
- 11 xor %edx, %edx
- 12 inc %ebx
- 13 cmp %ebx, %esi
- 14 jle prepare_loop
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement