This repository has been archived on 2025-10-23. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nub-lang-archive/std/runtime.asm
2025-05-05 16:38:41 +02:00

30 lines
363 B
NASM

global _start
extern main, gc_init
section .text
_start:
call gc_init
call main
mov rax, 60
mov rdi, 0
syscall
global nub_strcmp
section .text
nub_strcmp:
xor rdx, rdx
.loop:
mov al, [rsi + rdx]
mov bl, [rdi + rdx]
inc rdx
cmp al, bl
jne .not_equal
cmp al, 0
je .equal
jmp .loop
.not_equal:
mov rax, 0
ret
.equal:
mov rax, 1
ret