[SPCA] Format

This commit is contained in:
2026-01-11 08:05:05 +01:00
parent 35c06e4edf
commit acffe6b3e6
4 changed files with 24 additions and 24 deletions

View File

@@ -1,13 +1,13 @@
sum: // Label
endbr64 // Indirect Branch target (No effect on code's logic)
pushq %rbp // Preserve caller stack frame
movq %rsp, %rbp // Set up new stack frame
movl %edi, -20(%rbp) // Arg1 register -> stack
movl %esi, -24(%rbp) // Arg2 register -> stack
movl -20(%rbp), %edx // stack[Arg1] -> gp register
movl -24(%rbp), %eax // stack[Arg2] -> gp register
addl %edx, %eax // Add Arg1 + Arg2 -> gp register
movl %eax, -4(%rbp) // result -> stack
movl -4(%rbp), %eax // stack[result] -> return register
popq %rbp // Restore caller stack frame
ret // jump back to caller
sum: # Label
endbr64 # Indirect Branch target (No effect on code's logic)
pushq %rbp # Preserve caller stack frame
movq %rsp, %rbp # Set up new stack frame
movl %edi, -20(%rbp) # Arg1 register -> stack
movl %esi, -24(%rbp) # Arg2 register -> stack
movl -20(%rbp), %edx # stack[Arg1] -> gp register
movl -24(%rbp), %eax # stack[Arg2] -> gp register
addl %edx, %eax # Add Arg1 + Arg2 -> gp register
movl %eax, -4(%rbp) # result -> stack
movl -4(%rbp), %eax # stack[result] -> return register
popq %rbp # Restore caller stack frame
ret # jump back to caller