changed the way that functions are defined

This commit is contained in:
IgorCielniak
2026-01-08 15:28:10 +01:00
parent d4dc6ceef5
commit b9098d9893
33 changed files with 232 additions and 198 deletions

View File

@@ -4,15 +4,15 @@
# and prints that much consequent elements
# from the stack while not modifying it
: dump
1 swap
word dump
1 swap
for
dup pick
dup pick
puti cr
1 +
1 +
end
drop
;
drop
end
# : int3 ( -- )
:asm int3 {

View File

@@ -86,10 +86,10 @@
# Output
extern int printf(char* fmt, double x)
: fput
word fput
"%f" drop swap printf drop
;
end
: fputln
word fputln
"%f\n" drop swap printf drop
;
end

View File

@@ -343,5 +343,6 @@
}
;
: cr 10 putc ;
: puts write_buf cr ;
word cr 10 putc end
word puts write_buf cr end

View File

@@ -1,6 +1,6 @@
import stdlib.sl
: alloc
word alloc
0 # addr hint (NULL)
swap # size
3 # prot (PROT_READ | PROT_WRITE)
@@ -8,8 +8,8 @@ import stdlib.sl
-1 # fd
0 # offset
mmap
;
end
: free
word free
munmap drop
;
end