write_file

This commit is contained in:
IgorCielniak
2025-12-18 11:32:35 +01:00
parent 6efd7c4e19
commit 50451840b7
32 changed files with 3064 additions and 24 deletions

View File

@@ -18,6 +18,19 @@ _start:
mov rdi, rax
mov rax, 60
syscall
word_strlen:
mov rsi, [r12] ; addr
mov rcx, 0
strlen_loop:
mov al, [rsi + rcx]
cmp al, 0
je strlen_done
inc rcx
jmp strlen_loop
strlen_done:
mov [r12], rcx ; len
ret
ret
word_puts:
; detects string if top is len>=0 and next is a pointer in [data_start, data_end]
mov rax, [r12] ; len or int value