introduced direct ability to call syscalls and linux.sl
This commit is contained in:
2
tests/syscall_write.expected
Normal file
2
tests/syscall_write.expected
Normal file
@@ -0,0 +1,2 @@
|
||||
hello world!
|
||||
(via syscall3)
|
||||
33
tests/syscall_write.sl
Normal file
33
tests/syscall_write.sl
Normal file
@@ -0,0 +1,33 @@
|
||||
import ../stdlib/linux.sl
|
||||
|
||||
# to demonstrate the ability to not use the stdlib at all, the return codes of syscall are not handeled (droped), in a real world scenario you would want to drop them
|
||||
|
||||
word main
|
||||
1
|
||||
"hello"
|
||||
syscall.write
|
||||
syscall
|
||||
#drop
|
||||
|
||||
1
|
||||
" world"
|
||||
3
|
||||
syscall.write.num
|
||||
syscall
|
||||
#drop
|
||||
|
||||
1
|
||||
"!\n"
|
||||
syscall.write.argc
|
||||
syscall.write.num
|
||||
syscall
|
||||
#drop
|
||||
|
||||
1
|
||||
"(via syscall3)\n"
|
||||
syscall.write.num
|
||||
syscall3
|
||||
#drop
|
||||
|
||||
0
|
||||
end
|
||||
1
tests/syscall_write.test
Normal file
1
tests/syscall_write.test
Normal file
@@ -0,0 +1 @@
|
||||
python main.py tests/syscall_write.sl -o /tmp/syscall_write > /dev/null && /tmp/syscall_write
|
||||
Reference in New Issue
Block a user