some additions to core and test for them

This commit is contained in:
IgorCielniak
2026-02-03 18:43:04 +01:00
parent c2fcaf8f8d
commit ac4c55cb8e
4 changed files with 208 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
2
7
5
-1
8
8
4
-4
6
4
3
7
8
4
4
1
3
1
16838

26
tests/core_bitops.sl Normal file
View File

@@ -0,0 +1,26 @@
import ../stdlib/stdlib.sl
import ../stdlib/io.sl
word main
6 3 band puti cr
6 3 bor puti cr
6 3 bxor puti cr
0 bnot puti cr
1 3 shl puti cr
1 3 sal puti cr
8 1 shr puti cr
8 neg 1 sar puti cr
5 inc puti cr
5 dec puti cr
3 7 min puti cr
3 7 max puti cr
1 3 rol puti cr
8 1 ror puti cr
5 1 4 clamp puti cr
0 1 4 clamp puti cr
3 1 4 clamp puti cr
time 0 > puti cr
1 mem swap !
rand puti cr
0
end

1
tests/core_bitops.test Normal file
View File

@@ -0,0 +1 @@
python main.py tests/core_bitops.sl -o ./build/core_bitops > /dev/null && ./build/core_bitops