From a11df2c963520c64768158c2753237152a1eae3d Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Sat, 17 Apr 2021 17:31:46 +0200 Subject: Update --- Semestr 4/ask/lista6/puzzle7.s | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Semestr 4/ask/lista6/puzzle7.s (limited to 'Semestr 4/ask/lista6/puzzle7.s') diff --git a/Semestr 4/ask/lista6/puzzle7.s b/Semestr 4/ask/lista6/puzzle7.s new file mode 100644 index 0000000..6d26961 --- /dev/null +++ b/Semestr 4/ask/lista6/puzzle7.s @@ -0,0 +1,29 @@ + .global puzzle7 + + .text +puzzle7: + movq %rsi, -40(%rsp) + movq %rdx, -32(%rsp) + movq %rcx, -24(%rsp) + movq %r8, -16(%rsp) + movq %r9, -8(%rsp) + movl $8, -72(%rsp) + leaq 8(%rsp), %rax + movq %rax, -64(%rsp) + leaq -48(%rsp), %rax + movq %rax, -56(%rsp) + movl $0, %eax + jmp .L2 +.L3: movq -64(%rsp), %rdx + leaq 8(%rdx), %rcx + movq %rcx, -64(%rsp) +.L4: addq (%rdx), %rax +.L2: subq $1, %rdi + js .L6 + cmpl $47, -72(%rsp) + ja .L3 + movl -72(%rsp), %edx + addq -56(%rsp), %rdx + addl $8, -72(%rsp) + jmp .L4 +.L6: ret -- cgit v1.2.3