Adds _initializor to handle entry/exit. 'tests' now exits with 'amount of failed tests' as exit code

This commit is contained in:
2025-08-04 12:44:44 +02:00
parent 02580e9b0b
commit f790f5948c
4 changed files with 65 additions and 4 deletions

30
' Normal file
View File

@@ -0,0 +1,30 @@
%include "src/constants/sizes.asm"
extern exit
extern main
section .text
global _start
global stack_is_top
_start:
mov rdi, [rsp]
lea rsi, [rsp + SIZE_QWORD]
push rsp ;Can maybe used as a method to find out if we're at top of the stack
push -1
call main
mov rdi, rax
call exit
stack_is_top:
xor rax, rax
mov rdi, rsp
cmp rdi, [rsp]
je .yes
jmp .q
.yes:
inc al
.q:
ret