This commit is contained in:
nub31
2025-05-05 16:36:24 +02:00
parent f77fdb86f3
commit cca6fc55d6
9 changed files with 17 additions and 58 deletions

View File

@@ -1,10 +0,0 @@
global _start
extern main, gc_init
section .text
_start:
call gc_init
call main
mov rax, 60
mov rdi, 0
syscall

View File

@@ -1,23 +0,0 @@
section .bss
buffer resb 20
section .text
global itoa
itoa:
mov rax, rdi
mov rsi, buffer + 19
mov byte [rsi], 0
dec rsi
.loop:
xor rdx, rdx
mov rcx, 10
div rcx
add dl, '0'
mov [rsi], dl
dec rsi
test rax, rax
jnz .loop
inc rsi
mov rax, rsi
ret

View File

@@ -1,13 +0,0 @@
global str_len
section .text
str_len:
xor rax, rax
.loop:
cmp byte [rdi], 0
jz .done
inc rax
inc rdi
jmp .loop
.done:
ret

View File

@@ -1,7 +1,18 @@
global str_cmp
global _start
extern main, gc_init
section .text
str_cmp:
_start:
call gc_init
call main
mov rax, 60
mov rdi, 0
syscall
global base_str_cmp
section .text
base_str_cmp:
xor rdx, rdx
.loop:
mov al, [rsi + rdx]