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/puzzle.s | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 Semestr 4/ask/lista6/puzzle.s (limited to 'Semestr 4/ask/lista6/puzzle.s') diff --git a/Semestr 4/ask/lista6/puzzle.s b/Semestr 4/ask/lista6/puzzle.s deleted file mode 100644 index 3a39398..0000000 --- a/Semestr 4/ask/lista6/puzzle.s +++ /dev/null @@ -1,22 +0,0 @@ - .globl puzzle - - .text -puzzle: - push %rbp # adres koncu ramki, callee-saved - xorl %eax, %eax # zeruje %rax - mov %rsi, %rbp # rbp := rsi, czyli rbp := p - push %rbx # rbx na stos, callee-saved - mov %rdi, %rbx # rbx := rdi, czyli rbx := n - sub $24, %rsp # rsp -= 24, czyli przesun rsp o 3 bajty w dół - test %rdi, %rdi # rdi == 0?, czyli n == 0? - jle .L1 # jesli tak, skocz do L1 - lea 8(%rsp), %rsi # w p.w. rsi := rsp + 8 - lea (%rdi,%rdi), %rdi # rdi := 2*rdi - call puzzle # wywolanie rekurencyjne puzzle - add 8(%rsp), %rax # rax := rax + *(rsp + 8) - add %rax, %rbx # rbx := rbx + rax -.L1: mov %rbx, (%rbp) # *rbp := rbx, czyli *p := rbx - add $24, %rsp # rsp := rsp + 24 (przesun adres stacka o 3 bajty) - pop %rbx # przywracamy rbx - pop %rbp # przywracamy rbp - ret -- cgit v1.2.3