diff options
author | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-10-05 21:49:54 +0200 |
---|---|---|
committer | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-10-05 21:49:54 +0200 |
commit | c5fcf7179a83ef65c86c6a4a390029149e518649 (patch) | |
tree | d29ffc5b86a0d257453cedcf87d91a13d8bf3b0d /Semestr 4/ask/lista5/puzzle4.s | |
parent | f8a88b6a4aba1f66d04711a9330eaba49a50c463 (diff) |
Duzy commit ze smieciami
Diffstat (limited to 'Semestr 4/ask/lista5/puzzle4.s')
-rw-r--r-- | Semestr 4/ask/lista5/puzzle4.s | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/Semestr 4/ask/lista5/puzzle4.s b/Semestr 4/ask/lista5/puzzle4.s deleted file mode 100644 index 16ca386..0000000 --- a/Semestr 4/ask/lista5/puzzle4.s +++ /dev/null @@ -1,24 +0,0 @@ -.global puzzle4 - -.text -puzzle4: # argumenty: rdi - long*, rsi - long, rdx - uint64, rcx - uint64 - movq %rcx, %rax # rax := rcx - subq %rdx, %rax # rax -= rdx - shrq %rax # rax >>= 1; // ale logiczne! - addq %rdx, %rax # rax += rdx; - cmpq %rdx, %rcx # if rcx < rdx - jb .L5 # then jump to L5 - movq (%rdi,%rax,8), %r8 # r8 = *(rdi + 8*rax) - cmpq %rsi, %r8 # if rsi == r8 - je .L10 # then jump to L10 - cmpq %rsi, %r8 # if (r8 - rsi < 0) <=> r8 < rsi - jg .L11 # then jump to L11 - leaq 1(%rax), %rdx # rdx := rax + 1 - call puzzle4 # call recursively puzzle4 -.L10: ret # return rax -.L11: leaq -1(%rax), %rcx # rcx := rax - 1 - call puzzle4 # call recursively puzzle4 - ret # return rax -.L5: movl $-1, %eax # eax := -1 - ret # return rax - |