From c5fcf7179a83ef65c86c6a4a390029149e518649 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Tue, 5 Oct 2021 21:49:54 +0200 Subject: Duzy commit ze smieciami --- Semestr 4/ask/lista6/puzzle8.s | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 Semestr 4/ask/lista6/puzzle8.s (limited to 'Semestr 4/ask/lista6/puzzle8.s') diff --git a/Semestr 4/ask/lista6/puzzle8.s b/Semestr 4/ask/lista6/puzzle8.s deleted file mode 100644 index cc3805d..0000000 --- a/Semestr 4/ask/lista6/puzzle8.s +++ /dev/null @@ -1,30 +0,0 @@ -# rdi - adres zwracanej struktury (niejawnie) -# rsi - *a -# rdx - n - - .global puzzle8 - - .text -puzzle8: - movq %rdx, %r11 # r11 := n - xorl %r10d, %r10d # r10 := 0 - xorl %eax, %eax # rax := 0 - movq $LONG_MIN, %r8 # r8 := 0x800... - movq $LONG_MAX, %r9 # r9 := 0x7ff... -.L2: cmpq %r11, %r10 # if n <= r10 - jge .L5 # then jump to L5, else - movq (%rsi,%r10,8), %rcx # rcx := a[r10] - cmpq %rcx, %r9 # if a[r10] < r9 - cmovg %rcx, %r9 # then r9 = a[r10] - cmpq %rcx, %r8 # if a[r10] > r8 - cmovl %rcx, %r8 # then r8 = a[r10] - addq %rcx, %rax # rax += a[r10] - incq %r10 # r10++ - jmp .L2 -.L5: cqto # jeśli rax < 0 to niech rdx zaplonie - movq %r9, (%rdi) # rdi->0 := r9 - idivq %r11 # podziel rax przez r11, efektywnie rax /= r11 - movq %r8, 8(%rdi) # rdi->8 := r8 - movq %rax, 16(%rdi) # rdi->16 := rax - movq %rdi, %rax # rax := rdi - ret \ No newline at end of file -- cgit v1.2.3