changed the way that functions are defined
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
@@ -343,5 +343,6 @@
|
||||
}
|
||||
;
|
||||
|
||||
: cr 10 putc ;
|
||||
: puts write_buf cr ;
|
||||
word cr 10 putc end
|
||||
|
||||
word puts write_buf cr end
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user