Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .global _add
- .type _add, @function
- .text
- _add:
- push %rbp
- mov %rsp, %rbp
- push %rax
- push %rbx
- push %rcx
- mov 0x10(%rbp), %rax # lhs
- mov 0x18(%rbp), %rbx # rhs
- xor %rcx, %rcx # i = 0
- clc
- pushf
- loop:
- popf
- movl (%rax, %rcx, 4), %esi # rhs[i]
- movl (%rbx, %rcx, 4), %edi # lhs[i]
- adc %esi, %edi
- movl %edi, (%rbx, %rcx, 4)
- inc %rcx
- pushf
- cmp %rcx, %rdx # i != block_count
- jnz loop
- popf
- pop %rcx
- pop %rbx
- pop %rax
- pop %rbp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement