Optimized cross-platform embeddable virtual machine, suitable for desktop and embedded, from 8-bit to 64-bit
Revisión | 1a44d443d905b1ec70cfbdf2973d2745d6161f5f (tree) |
---|---|
Tiempo | 2023-04-05 13:37:07 |
Autor | AlaskanEmily <emily@alas...> |
Commiter | AlaskanEmily |
Add license.
@@ -1,3 +1,6 @@ | ||
1 | +# Any copyright is dedicated to the Public Domain. | |
2 | +# https://creativecommons.org/publicdomain/zero/1.0/ | |
3 | + | |
1 | 4 | # clang/GCC GNU makefile. |
2 | 5 | |
3 | 6 | STAR_CC_FOUND!=which gcc 2>/dev/null || which clang 2>/dev/null || echo cc |
@@ -0,0 +1,28 @@ | ||
1 | +Copyright (c) 2023 AlaskanEmily | |
2 | + | |
3 | +Redistribution and use in source and binary forms, with or without | |
4 | +modification, are permitted provided that the following conditions | |
5 | +are met: | |
6 | + | |
7 | + 1. Redistributions of source code must retain the above copyright | |
8 | + notice, this list of conditions and the following disclaimer. | |
9 | + | |
10 | + 2. Redistributions in binary form must reproduce the above copyright | |
11 | + notice, this list of conditions and the following disclaimer in | |
12 | + the documentation and/or other materials provided with the | |
13 | + distribution. | |
14 | + | |
15 | + 3. Trans rights are human rights. | |
16 | + | |
17 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | +DAMAGE. |
@@ -1,3 +1,6 @@ | ||
1 | +# Any copyright is dedicated to the Public Domain. | |
2 | +# https://creativecommons.org/publicdomain/zero/1.0/ | |
3 | + | |
1 | 4 | # clang/GCC BSD makefile. |
2 | 5 | |
3 | 6 | .ifndef STAR_CC |
@@ -1,4 +1,33 @@ | ||
1 | 1 | %{ |
2 | +/* Copyright (c) 2023 AlaskanEmily | |
3 | + * | |
4 | + * Redistribution and use in source and binary forms, with or without | |
5 | + * modification, are permitted provided that the following conditions | |
6 | + * are met: | |
7 | + * | |
8 | + * 1. Redistributions of source code must retain the above copyright | |
9 | + * notice, this list of conditions and the following disclaimer. | |
10 | + * | |
11 | + * 2. Redistributions in binary form must reproduce the above copyright | |
12 | + * notice, this list of conditions and the following disclaimer in | |
13 | + * the documentation and/or other materials provided with the | |
14 | + * distribution. | |
15 | + * | |
16 | + * 3. Trans rights are human rights. | |
17 | + * | |
18 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
21 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
22 | + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
23 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
24 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
25 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
26 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
27 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
28 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
29 | + * DAMAGE. | |
30 | + */ | |
2 | 31 | |
3 | 32 | #define YY_SKIP_YYWRAP |
4 | 33 | #define YY_NO_UNPUT |
@@ -1,3 +1,5 @@ | ||
1 | +# Any copyright is dedicated to the Public Domain. | |
2 | +# https://creativecommons.org/publicdomain/zero/1.0/ | |
1 | 3 | |
2 | 4 | all: libstarvm.a staras1 |
3 | 5 |
@@ -1,4 +1,33 @@ | ||
1 | 1 | %{ |
2 | +/* Copyright (c) 2023 AlaskanEmily | |
3 | + * | |
4 | + * Redistribution and use in source and binary forms, with or without | |
5 | + * modification, are permitted provided that the following conditions | |
6 | + * are met: | |
7 | + * | |
8 | + * 1. Redistributions of source code must retain the above copyright | |
9 | + * notice, this list of conditions and the following disclaimer. | |
10 | + * | |
11 | + * 2. Redistributions in binary form must reproduce the above copyright | |
12 | + * notice, this list of conditions and the following disclaimer in | |
13 | + * the documentation and/or other materials provided with the | |
14 | + * distribution. | |
15 | + * | |
16 | + * 3. Trans rights are human rights. | |
17 | + * | |
18 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
21 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
22 | + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
23 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
24 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
25 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
26 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
27 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
28 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
29 | + * DAMAGE. | |
30 | + */ | |
2 | 31 | #define yyerror Star_ASM_Error |
3 | 32 | #include "star_asm.h" |
4 | 33 | %} |
@@ -1,3 +1,32 @@ | ||
1 | +/* Copyright (c) 2023 AlaskanEmily | |
2 | + * | |
3 | + * Redistribution and use in source and binary forms, with or without | |
4 | + * modification, are permitted provided that the following conditions | |
5 | + * are met: | |
6 | + * | |
7 | + * 1. Redistributions of source code must retain the above copyright | |
8 | + * notice, this list of conditions and the following disclaimer. | |
9 | + * | |
10 | + * 2. Redistributions in binary form must reproduce the above copyright | |
11 | + * notice, this list of conditions and the following disclaimer in | |
12 | + * the documentation and/or other materials provided with the | |
13 | + * distribution. | |
14 | + * | |
15 | + * 3. Trans rights are human rights. | |
16 | + * | |
17 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | + * DAMAGE. | |
29 | + */ | |
1 | 30 | #include "star_asm.h" |
2 | 31 | |
3 | 32 | #include "y.tab.h" |
@@ -1,3 +1,32 @@ | ||
1 | +/* Copyright (c) 2023 AlaskanEmily | |
2 | + * | |
3 | + * Redistribution and use in source and binary forms, with or without | |
4 | + * modification, are permitted provided that the following conditions | |
5 | + * are met: | |
6 | + * | |
7 | + * 1. Redistributions of source code must retain the above copyright | |
8 | + * notice, this list of conditions and the following disclaimer. | |
9 | + * | |
10 | + * 2. Redistributions in binary form must reproduce the above copyright | |
11 | + * notice, this list of conditions and the following disclaimer in | |
12 | + * the documentation and/or other materials provided with the | |
13 | + * distribution. | |
14 | + * | |
15 | + * 3. Trans rights are human rights. | |
16 | + * | |
17 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | + * DAMAGE. | |
29 | + */ | |
1 | 30 | #ifndef STAR_ASM_H |
2 | 31 | #define STAR_ASM_H |
3 | 32 | #pragma once |
@@ -1,3 +1,33 @@ | ||
1 | +/* Copyright (c) 2023 AlaskanEmily | |
2 | + * | |
3 | + * Redistribution and use in source and binary forms, with or without | |
4 | + * modification, are permitted provided that the following conditions | |
5 | + * are met: | |
6 | + * | |
7 | + * 1. Redistributions of source code must retain the above copyright | |
8 | + * notice, this list of conditions and the following disclaimer. | |
9 | + * | |
10 | + * 2. Redistributions in binary form must reproduce the above copyright | |
11 | + * notice, this list of conditions and the following disclaimer in | |
12 | + * the documentation and/or other materials provided with the | |
13 | + * distribution. | |
14 | + * | |
15 | + * 3. Trans rights are human rights. | |
16 | + * | |
17 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | + * DAMAGE. | |
29 | + */ | |
30 | + | |
1 | 31 | #include "star_vm.h" |
2 | 32 | |
3 | 33 | /*****************************************************************************/ |
@@ -1,3 +1,32 @@ | ||
1 | +/* Copyright (c) 2023 AlaskanEmily | |
2 | + * | |
3 | + * Redistribution and use in source and binary forms, with or without | |
4 | + * modification, are permitted provided that the following conditions | |
5 | + * are met: | |
6 | + * | |
7 | + * 1. Redistributions of source code must retain the above copyright | |
8 | + * notice, this list of conditions and the following disclaimer. | |
9 | + * | |
10 | + * 2. Redistributions in binary form must reproduce the above copyright | |
11 | + * notice, this list of conditions and the following disclaimer in | |
12 | + * the documentation and/or other materials provided with the | |
13 | + * distribution. | |
14 | + * | |
15 | + * 3. Trans rights are human rights. | |
16 | + * | |
17 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | + * DAMAGE. | |
29 | + */ | |
1 | 30 | #ifndef STAR_VM_H |
2 | 31 | #define STAR_VM_H |
3 | 32 |
@@ -1,3 +1,33 @@ | ||
1 | +; Copyright (c) 2023 AlaskanEmily | |
2 | +; | |
3 | +; Redistribution and use in source and binary forms, with or without | |
4 | +; modification, are permitted provided that the following conditions | |
5 | +; are met: | |
6 | +; | |
7 | +; 1. Redistributions of source code must retain the above copyright | |
8 | +; notice, this list of conditions and the following disclaimer. | |
9 | +; | |
10 | +; 2. Redistributions in binary form must reproduce the above copyright | |
11 | +; notice, this list of conditions and the following disclaimer in | |
12 | +; the documentation and/or other materials provided with the | |
13 | +; distribution. | |
14 | +; | |
15 | +; 3. Trans rights are human rights. | |
16 | +; | |
17 | +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | +; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | +; COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | +; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | +; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | +; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | +; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | +; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | +; THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | +; DAMAGE. | |
29 | +; | |
30 | +; YASM/NASM implementation of the Star VM. | |
1 | 31 | ; Constants for MOT/YASM/TASM/etc implementations of the Star VM. |
2 | 32 | |
3 | 33 | STAR_VM_STACK_SIZE equ 123 |
@@ -1,3 +1,6 @@ | ||
1 | +/* Any copyright is dedicated to the Public Domain. | |
2 | + * https://creativecommons.org/publicdomain/zero/1.0/ */ | |
3 | + | |
1 | 4 | #include "star_vm.h" |
2 | 5 | |
3 | 6 | #include <stdio.h> |
@@ -1,3 +1,32 @@ | ||
1 | +; Copyright (c) 2023 AlaskanEmily | |
2 | +; | |
3 | +; Redistribution and use in source and binary forms, with or without | |
4 | +; modification, are permitted provided that the following conditions | |
5 | +; are met: | |
6 | +; | |
7 | +; 1. Redistributions of source code must retain the above copyright | |
8 | +; notice, this list of conditions and the following disclaimer. | |
9 | +; | |
10 | +; 2. Redistributions in binary form must reproduce the above copyright | |
11 | +; notice, this list of conditions and the following disclaimer in | |
12 | +; the documentation and/or other materials provided with the | |
13 | +; distribution. | |
14 | +; | |
15 | +; 3. Trans rights are human rights. | |
16 | +; | |
17 | +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
20 | +; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
21 | +; COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | +; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | +; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | +; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | +; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | +; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |
27 | +; THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | +; DAMAGE. | |
29 | +; | |
1 | 30 | ; YASM/NASM implementation of the Star VM. |
2 | 31 | |
3 | 32 | USE32 |