write_file
This commit is contained in:
13
build/a.asm
13
build/a.asm
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user