add: strlen, putchar, putstr

This commit is contained in:
Camille Chauvet 2023-06-12 17:29:54 +00:00
parent 5fbf3f7e5a
commit 4e65a7f1c0
3 changed files with 23 additions and 0 deletions

3
src/putchar.🗿 Normal file
View File

@ -0,0 +1,3 @@
putchar(c){
wrt c;
}

11
src/putstr.🗿 Normal file
View File

@ -0,0 +1,11 @@
putstr(str)
{
local i;
i = 0;
loop {
if ([str + i] == 0)
return;
putchar([str + i]);
i = i + 1;
}
}

9
src/strlen.🗿 Normal file
View File

@ -0,0 +1,9 @@
strlen(str) {
local i;
i = 0;
loop {
if ([str + i] == 0)
return (i);
i = i + 1;
}
}