Added basic putuint to the standard library, i need to implement proper 0 handling but that probably needs and if statement

This commit is contained in:
cannoli-fruit 2026-07-26 01:48:43 -04:00
commit 5b7dd220ae
6 changed files with 94 additions and 2 deletions

View file

@ -6,6 +6,22 @@ proc getchar
0xCFFFFFFFFFFFFFFE ld8
endproc
proc putuint
@val
1 @divisor
while &val &divisor u/ 9 u> do
10 &divisor u* @divisor
endwhile
while &divisor 0 u> do
&val &divisor u/ 10 u%
48 u+ :putchar
&divisor 10 u/ @divisor
endwhile
endproc
proc puts
while dup ld8 0 == not do
dup ld8 :putchar