cleanup
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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]
|
||||
Reference in New Issue
Block a user