added abs to stdlib.sl and made a toint function, I'm gonna kms

This commit is contained in:
IgorCielniak
2026-01-12 10:32:25 +01:00
parent 155b0eae07
commit 4fe4d26511
2 changed files with 50 additions and 0 deletions

View File

@@ -474,6 +474,17 @@
}
;
# : abs ( x -- |x| )
:asm abs {
mov rax, [r12] ; get value
test rax, rax ; check sign
jge .done ; keep if non-negative
neg rax ; flip sign when negative
.done:
mov [r12], rax ; store result
}
;
# : bitnot ( 0|1 -- 1|0 )
:asm bitnot {
mov rax, [r12] ; get value