This commit is contained in:
nub31
2025-06-14 19:00:45 +02:00
parent d57d95ec8e
commit 04fb47ef32
8 changed files with 27 additions and 26 deletions

View File

@@ -1,14 +1,19 @@
.intel_Syntax noprefix
.section .text
.intel_syntax noprefix
# func nub_panic(message: ^u8, message_length: u64): void
.global nub_panic
nub_panic:
mov rdx, rsi
mov rsi, rdi
mov rax, 1
mov rdi, 2
.section .data
.align 8
array_out_of_bounds:
.ascii "Index is out of bounds of array\n"
.section .text
.global nub_panic_array_oob
nub_panic_array_oob:
mov rax, 1 # syscall = sys_write
mov rdi, 2 # fd = stderr
lea rsi, [rip + array_out_of_bounds] # message
mov rdx, 32 # message length
syscall
mov rax, 60
mov rdi, 101
mov rax, 60 # sys_exit
mov rdi, 101 # exit code
syscall