WE CAN RETURN VALUES FROM FUNCTIONS LESS GOOO

This commit is contained in:
SpookyDervish
2025-09-10 07:54:11 +10:00
parent 59bef834c4
commit 3103d17026
5 changed files with 46 additions and 15 deletions

10
out.asm
View File

@@ -7,14 +7,9 @@ section .text
global _start
_start:
call test
push 2
push 3
mov rax, [rsp + 8]
mov rbx, [rsp + 0]
add rax, rbx
mov QWORD [rsp + 8], rax
push rax
mov rax, 60
mov rdi, [rsp + 8]
mov rdi, [rsp + 0]
syscall
test:
mov rsi, .LC0
@@ -22,4 +17,5 @@ mov rdx, .LC1
mov rax, 1
mov rdi, 1
syscall
mov rax, 123
ret