[SPCA] Improve Stack section

This commit is contained in:
RobinB27 committed 2026-01-13 14:46:30 +01:00
1 parent b1ff4cf1dd
commit 4629cb75e1
7 files changed
+65 -12

No files matched your search

@@ -0,0 +1,12 @@
factorial:
pushq %rbx # Preserve frame pointer
movl %edi, %ebx
movl $1, %eax
cmpl $1, %edi
jle .QUIT # Base case reached: quit
leal -1(%rdi), %edi # Prepare args for next function call
call factorial
imull %ebx, %eax # Use result of function call
.QUIT:
popq %rbx # Restore frame pointer
ret