This commit is contained in:
Scarlett
2025-05-06 15:34:55 -04:00
parent 596434e152
commit c8491b62e4
49 changed files with 1560 additions and 339 deletions

View File

@ -1,8 +1,25 @@
movl $3, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl -8(%rbp), %eax #negation start
negl %eax
movl %eax, -12(%rbp) #negation end
.globl entry
entry:
pushq %rbp
movq %rsp, %rbp
subq $128, %rsp
movl %edi, -8(%rbp) #FunctionStart1param end
movl $3, -12(%rbp) #constant assign
.L1:
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -16(%rbp), %eax #negation start
negl %eax
movl %eax, -20(%rbp) #negation end
.L2:
movl -20(%rbp), %eax #assign start
movl %eax, -24(%rbp) #assign end
movl -24(%rbp), %edi #adding param start
call printInteger
movl %eax, -28(%rbp) #store return from call
.L3:
movl -28(%rbp), %eax #assign start
movl %eax, -32(%rbp) #assign end
movl -24(%rbp), %eax #return y
leave
ret