Commit Graph

1637 Commits

Author SHA1 Message Date
Irmen de Jong
d305a44557 check for non-executed statements in main block 2018-12-19 03:04:27 +01:00
Irmen de Jong
c1204b83bd changed syntax of subroutine parameters (now the same as vardecls) 2018-12-19 02:51:22 +01:00
Irmen de Jong
00ad285d3f fix array value initialization type conversions 2018-12-19 00:57:57 +01:00
Irmen de Jong
3a7b341f47 fixes 2018-12-18 18:32:41 +01:00
Irmen de Jong
ca1d6bff56 log functions 2018-12-18 02:02:19 +01:00
Irmen de Jong
4be6a2eeef abs() 2018-12-18 01:43:04 +01:00
Irmen de Jong
bcfb390077 optimizations 2018-12-17 15:52:37 +01:00
Irmen de Jong
4a309d1e12 more functions and fixed iteration over variable 2018-12-17 13:49:19 +01:00
Irmen de Jong
178a46ad7f any and all 2018-12-17 01:59:04 +01:00
Irmen de Jong
13a5a06ffb len() 2018-12-16 13:58:18 +01:00
Irmen de Jong
2478c73bc0 more asm float calculations 2018-12-16 03:38:17 +01:00
Irmen de Jong
b9958412c7 allow passing byte/word for register/registerpair arguments, fix stackvm string parameter handling 2018-12-15 00:38:21 +01:00
Irmen de Jong
8597ea2ec7 correct printing of numbers 2018-12-14 23:15:44 +01:00
Irmen de Jong
7cb42de60e more float asm operations, fix some % operator problems 2018-12-13 01:19:43 +01:00
Irmen de Jong
584cc1dedb asm conversions to float 2018-12-12 01:13:13 +01:00
Irmen de Jong
d6cf8bcce0 fixed return values problem and wrong optimization into jump 2018-12-12 00:15:05 +01:00
Irmen de Jong
756930a54f return values problem 2018-12-11 01:54:51 +01:00
Irmen de Jong
be819ba8a7 got the number guessing example fully working on c64 asm 2018-12-11 00:09:37 +01:00
Irmen de Jong
a499ac6def string to byte 2018-12-10 09:25:38 +01:00
Irmen de Jong
f070dc22bb save X register automatically when calling sub that clobbers X 2018-12-09 19:48:59 +01:00
Irmen de Jong
b8150f645d word and uword and float comparisons 2018-12-09 17:28:34 +01:00
Irmen de Jong
21b9c2f011 sbyte less than 2018-12-09 04:10:50 +01:00
Irmen de Jong
db3d3727c2 ubyte comparisons 2018-12-08 18:54:31 +01:00
Irmen de Jong
ef2ae60868 byte/word asm comparisons 2018-12-08 17:21:34 +01:00
Irmen de Jong
432960da8b floats and random number stuff 2018-12-07 00:57:32 +01:00
Irmen de Jong
80c69d83c6 random number stuff 2018-12-06 01:25:06 +01:00
Irmen de Jong
0c64d7ffe5 more asm, constants now also outputted in asm source 2018-12-05 00:30:56 +01:00
Irmen de Jong
08224d5367 error/warning colors 2018-12-04 00:54:18 +01:00
Irmen de Jong
bf5f7a271e various 2018-12-04 00:19:13 +01:00
Irmen de Jong
711d6f4ee5 fix memory pointer variables in the StackVm 2018-12-02 23:53:09 +01:00
Irmen de Jong
89ac374db9 float stuff 2018-12-02 17:59:36 +01:00
Irmen de Jong
211609c481 string param passing 2018-11-28 01:12:23 +01:00
Irmen de Jong
8a2584c7df added JZ/JNZ/etc opcodes for conditional jumps based on stack value
fix function parameter replacement of auto-heaped strings
2018-11-27 00:35:37 +01:00
Irmen de Jong
f9ed92dc3a fix function parameter datatype checks 2018-11-26 22:12:36 +01:00
Irmen de Jong
30e2bdad79 fix some problems with subroutine parameters 2018-11-26 01:18:06 +01:00
Irmen de Jong
43c99f1d89 strings of len 1 are no longer converted to byte value, plus some other tweaks 2018-11-25 23:42:37 +01:00
Irmen de Jong
d1b750ea55 fix launching of Vice 2018-11-25 01:17:39 +01:00
Irmen de Jong
849bfde515 auto converting string literals to variables and asm generation 2018-11-24 03:25:59 +01:00
Irmen de Jong
6c8354aef0 taking the address of strings and arrays 2018-11-23 00:31:21 +01:00
Irmen de Jong
069f6ea372 improved assignment of single character values and strings 2018-11-22 00:58:21 +01:00
Irmen de Jong
48a6a05109 improve datatype assignment checks 2018-11-22 00:01:41 +01:00
Irmen de Jong
c40fc584d6 added warning about using X as sub parameter 2018-11-21 22:07:13 +01:00
Irmen de Jong
e89788eeab adjust return value literal type to subroutine return type 2018-11-21 00:02:02 +01:00
Irmen de Jong
034973a9e6 asm fixes 2018-11-20 18:01:53 +01:00
Irmen de Jong
c90230d33a tweaking multiple assignment targets 2018-11-19 23:56:54 +01:00
Irmen de Jong
fad74a6ae0 tweaking multiple assignment targets 2018-11-19 01:31:07 +01:00
Irmen de Jong
a2a8a772ec tweaking multiple assignment targets 2018-11-15 00:49:06 +01:00
Irmen de Jong
23c1167d7f tweaking multiple assignment targets 2018-11-14 01:50:16 +01:00
Irmen de Jong
4ade45f51f tweaking subroutine return values 2018-11-11 18:19:08 +01:00
Irmen de Jong
95b05d08b3 better solution for registerpair as subroutine param/returnvalue 2018-11-10 12:25:46 +01:00
Irmen de Jong
c415f731da make registerpair compile again as subroutine param/returnvalue 2018-11-10 00:53:50 +01:00
Irmen de Jong
171d5b0a35 tweaks 2018-11-09 23:42:17 +01:00
Irmen de Jong
886464d94a assignments 2018-11-09 00:23:51 +01:00
Irmen de Jong
9c26066dcb assignments 2018-11-07 02:37:48 +01:00
Irmen de Jong
37b07e254e assignments 2018-11-06 01:38:47 +01:00
Irmen de Jong
783db2f88b assignments 2018-11-03 00:02:31 +01:00
Irmen de Jong
d6432df90d got rid of 16-bit register pair variables (AX, AY, XY) they were complicating things too much 2018-11-02 22:06:57 +01:00
Irmen de Jong
54e52a910a assignments 2018-11-02 21:34:12 +01:00
Irmen de Jong
4ef680f6fd assignments 2018-11-01 23:42:10 +01:00
Irmen de Jong
a550e2b413 assignments 2018-11-01 00:56:07 +01:00
Irmen de Jong
82c6794e3b assignments 2018-10-31 00:50:53 +01:00
Irmen de Jong
625791e5e8 removed support for indexing on register pairs 2018-10-30 23:20:09 +01:00
Irmen de Jong
6d21274090 assignments 2018-10-30 22:15:38 +01:00
Irmen de Jong
5bf2c4a798 got rid of matrix type 2018-10-30 20:29:03 +01:00
Irmen de Jong
98a8ff4587 asm fixes 2018-10-30 17:39:22 +01:00
Irmen de Jong
5361379187 Merge remote-tracking branch 'origin/master' 2018-10-30 11:12:25 +01:00
Irmen de Jong
05fc6fa47a tweaks 2018-10-30 09:22:32 +01:00
Irmen de Jong
1e776b1f53 Merge remote-tracking branch 'origin/master' 2018-10-29 10:24:30 +01:00
Irmen de Jong
8446dd567b assignments again 2018-10-29 02:05:22 +01:00
Irmen de Jong
729d931ccb assignments again 2018-10-27 23:03:46 +02:00
Irmen de Jong
7c4846700b simplified opcodes (removed COPY_XXX and MEM signed/unsigned distinction) 2018-10-27 22:08:46 +02:00
Irmen de Jong
f4e2641f7c assignments and stuff 2018-10-27 21:26:32 +02:00
Irmen de Jong
a23673fe83 array assignments etc 2018-10-27 02:09:23 +02:00
Irmen de Jong
0235864d0b asm fixes 2018-10-26 11:50:06 +02:00
Irmen de Jong
f541dd3bfd regenerate parser 2018-10-26 02:14:33 +02:00
Irmen de Jong
5203dad7c1 more asm output 2018-10-26 01:44:01 +02:00
Irmen de Jong
595bf7ad4b more asm output 2018-10-25 01:05:35 +02:00
Irmen de Jong
f42a036fc5 more asm output, added COPY_MEM_XXX optimized opcodes 2018-10-25 00:28:50 +02:00
Irmen de Jong
4effd0b3db asm fixes 2018-10-24 17:51:56 +02:00
Irmen de Jong
fba3cb7301 more asm output 2018-10-24 01:39:52 +02:00
Irmen de Jong
ab73353cd2 fix expression simplification issue 2018-10-23 23:05:08 +02:00
Irmen de Jong
a825bbff96 fix array problems, limit size of arrays. 2018-10-23 00:52:51 +02:00
Irmen de Jong
b8f3f942d4 implemented all bit rotate and shift operations 2018-10-22 01:02:24 +02:00
Irmen de Jong
da3f79c092 another way to generate asm 2018-10-21 20:26:18 +02:00
Irmen de Jong
79462b3448 fixed some problems with builtin functions 2018-10-20 23:53:39 +02:00
Irmen de Jong
c01114db9f more asm 2018-10-18 02:14:13 +02:00
Irmen de Jong
bcedb5f5e3 fix some asm 2018-10-17 18:11:36 +02:00
Irmen de Jong
067426016d more asm 2018-10-17 01:01:01 +02:00
Irmen de Jong
1e0ce40d1d included libs are now carried over to asm properly 2018-10-16 22:58:30 +02:00
Irmen de Jong
529c525081 inline asm and fixed c64 libs 2018-10-16 02:36:14 +02:00
Irmen de Jong
263b197fec more asm 2018-10-16 01:24:40 +02:00
Irmen de Jong
85f6c5350c more asm 2018-10-15 02:49:59 +02:00
Irmen de Jong
ba384c9722 rsave/rrestore added 2018-10-14 22:32:03 +02:00
Irmen de Jong
b52120139c 6502 start 2018-10-14 01:55:39 +02:00
Irmen de Jong
b7d8f026f4 refactor 2018-10-13 18:17:06 +02:00
Irmen de Jong
dff4518608 intermediate program written in blocks 2018-10-13 16:55:01 +02:00
Irmen de Jong
987915a77a doc 2018-10-12 18:01:40 +02:00
Irmen de Jong
7aec14524e fix datatype conversion issues 2018-10-12 15:50:32 +02:00
Irmen de Jong
cc54e3ec99 fix array initialization 2018-10-12 00:55:21 +02:00
Irmen de Jong
1fe5c943fd adding singed integer datatypes 2018-10-11 21:50:10 +02:00
Irmen de Jong
2f7d03b6ab adding singed integer datatypes 2018-10-10 09:21:20 +02:00
Irmen de Jong
f5261a3425 added %zpreserved 2018-10-09 00:01:53 +02:00
Irmen de Jong
42394f561b syntax checks on asmsubs 2018-10-08 22:35:39 +02:00
Irmen de Jong
50464ebda1 syntax checks on asmsubs 2018-10-08 21:57:36 +02:00
Irmen de Jong
9d10210466 optimized var copying 2018-10-08 02:24:35 +02:00
Irmen de Jong
c2a1cb956a allow to re-assign string variables 2018-10-08 01:20:53 +02:00
Irmen de Jong
3ac2385d4b optimize calls/jumps and loops with always known conditions. 2018-10-07 23:29:27 +02:00
Irmen de Jong
7b51597fe9 some more typecheckings and indexing on matrixes 2018-10-07 21:20:04 +02:00
Irmen de Jong
34d26e42e1 fixed some type checks 2018-10-07 02:05:26 +02:00
Irmen de Jong
30b58c8567 variables are reset to their declared value when entering the scope again 2018-10-07 00:21:13 +02:00
Irmen de Jong
314e5ca9e2 correct type for word array initialization value 2018-10-06 23:07:57 +02:00
Irmen de Jong
6edd5f9b30 can now declare for loop variable on the spot 2018-10-06 22:54:03 +02:00
Irmen de Jong
1d37841575 for, while, repeat, if, branch bodies are now (anonymous) symbol scopes 2018-10-06 18:42:06 +02:00
Irmen de Jong
7b650ffa18 added bitmap characters 2018-10-06 02:16:07 +02:00
Irmen de Jong
a7abc32368 wrd and wrdhi functions added for byte-word conversion, more constant folding optimizations 2018-10-06 00:10:30 +02:00
Irmen de Jong
d13ced6d95 tweak 2018-10-05 18:36:23 +02:00
Irmen de Jong
b1dcc8093a optimize silly unneeded data conversions in stackvm code 2018-10-05 18:31:48 +02:00
Irmen de Jong
6350bf8024 fixed datatype conversions 2018-10-05 17:44:29 +02:00
Irmen de Jong
52e1661c8e even more opcodes type-specific 2018-10-05 16:57:13 +02:00
Irmen de Jong
e8ba21d3ba made a lot more opcodes type-specific 2018-10-05 13:58:37 +02:00
Irmen de Jong
42e4891fcf allowing vardecl with non-const initial value assignment 2018-10-05 00:29:46 +02:00
Irmen de Jong
2e4b5768b0 tweak subroutine order 2018-10-04 20:54:18 +02:00
Irmen de Jong
7d77504335 types 2018-10-04 02:30:23 +02:00
Irmen de Jong
bf75e7c00b types 2018-10-04 02:28:19 +02:00
Irmen de Jong
d2ffb1063b made more opcodes type-specific (will be needed for assembly generation later) 2018-10-04 02:17:18 +02:00
Irmen de Jong
4501276217 cube3d and tweaks 2018-10-03 01:57:16 +02:00
Irmen de Jong
4df397d057 merge asmsub and normal sub 2018-10-03 00:25:04 +02:00
Irmen de Jong
34fb82969c optimize assignment with literal value; const-convert value to target datatype literal if possible 2018-10-02 23:10:27 +02:00
Irmen de Jong
18c6165325 more complete for loops, various comma separated lists can now be split over multiple lines 2018-10-02 22:52:05 +02:00
Irmen de Jong
af0d52b5c2 assignment to array-indexed 2018-10-02 04:05:44 +02:00
Irmen de Jong
38e7d48492 implemented floating-point arrays 2018-10-02 02:20:42 +02:00
Irmen de Jong
0cdae48ce7 implemented array indexing 2018-10-01 22:23:16 +02:00
Irmen de Jong
8f26fdef61 changed the syntax of kernel/asm subroutines 2018-10-01 20:05:32 +02:00
Irmen de Jong
b96bb23a54 added gfx_line function 2018-10-01 01:01:39 +02:00
Irmen de Jong
623b42cc14 added single character literals (petscii byte value) 2018-09-30 23:07:26 +02:00
Irmen de Jong
3278d4c945 fixed function calls, added some string-to-number conversion functions 2018-09-30 22:43:34 +02:00
Irmen de Jong
734948c813 funcion call parameters are now checked against function signature 2018-09-30 20:58:47 +02:00
Irmen de Jong
d1589bef26 builtin funcs with multiple param types 2018-09-30 20:19:25 +02:00
Irmen de Jong
02075f2cf2 changed subroutine syntax and fixed array/matrix initalizer values 2018-09-30 18:49:58 +02:00
Irmen de Jong
505de87f27 builtin funcs 2018-09-30 16:25:00 +02:00
Irmen de Jong
34dec55eb2 fix builtin functions over non-const arrays/strings 2018-09-29 19:17:19 +02:00
Irmen de Jong
5ee427b72b enforce const on array/matrix values 2018-09-29 18:05:35 +02:00
Irmen de Jong
6b89bb7be5 strings and arrays are now stored in a 'heap' instead of in the value itself, to reflect how the target platform will store them 2018-09-29 17:33:59 +02:00
Irmen de Jong
d4232721fc improve check to see if expression is iterable 2018-09-29 10:07:27 +02:00
Irmen de Jong
814b7ce6aa track vars per block for later 6502 generation 2018-09-28 23:04:36 +02:00
Irmen de Jong
c5d251073f removed broken unused symbol clean up for now
streamlined irq routine handling and compilation
2018-09-28 21:28:16 +02:00
Irmen de Jong
4d7279b004 fix lsb, msb result data type 2018-09-28 19:35:34 +02:00
Irmen de Jong
1c036c4813 translating subroutine calls and returns 2018-09-28 02:26:56 +02:00
Irmen de Jong
bf5c2e07a2 subroutines cannot use builtin function names for parameters 2018-09-27 23:58:14 +02:00
Irmen de Jong
91f9229b07 fixed memory vars in compiler, added invalid assignment check 2018-09-27 23:21:04 +02:00
Irmen de Jong
7f28f8be11 60hz irq implemented in stackvm 2018-09-27 22:45:57 +02:00
Irmen de Jong
99d63b13a8 slightly simplified const grouping 2018-09-27 20:50:39 +02:00
Irmen de Jong
5e729e21ff added some more constant foldings 2018-09-27 01:35:35 +02:00
Irmen de Jong
6681787288 fix handling of (too) large integer literals, and range check crash 2018-09-26 21:37:46 +02:00
Irmen de Jong
0f53f87895 made stackvm source a bit more readable 2018-09-26 01:14:10 +02:00
Irmen de Jong
00baec12ab arithmetic statement optimizations added 2018-09-26 00:58:02 +02:00
Irmen de Jong
f85d8edeba added some more division by zero checks
bitwise operator optimizations
2018-09-25 22:16:32 +02:00
Irmen de Jong
a2c165839d optimize for loop over 1-valued range 2018-09-25 20:40:41 +02:00
Irmen de Jong
53cd50ad48 changed float handling and appropriate compiler messages 2018-09-25 19:52:59 +02:00
Irmen de Jong
d990b05998 compilation of prefix operators, added NOT opcode 2018-09-25 01:02:01 +02:00
Irmen de Jong
70e5a38aa2 changed set/clear carry and irqd somewhat 2018-09-24 23:38:33 +02:00
Irmen de Jong
cef0aae927 compilation of builtin functions to opcode
untit tests for stackvm opcodes, value and parser literalvalue
2018-09-24 22:34:12 +02:00
Irmen de Jong
3a0c1c5ada optimized mandelbrot example 2018-09-23 02:53:57 +02:00
Irmen de Jong
68037e4425 implemented while and repeat loops 2018-09-23 02:04:45 +02:00
Irmen de Jong
cfd63dc42a more opcodes unit tested 2018-09-22 14:16:48 +02:00
Irmen de Jong
4174d49fb3 for loop generates working code for the most often occurring loop scenarios 2018-09-22 02:43:10 +02:00
Irmen de Jong
f84e06bdeb tweak branches 2018-09-22 00:33:25 +02:00
Irmen de Jong
0137478ad4 tweaks 2018-09-21 22:43:29 +02:00
Irmen de Jong
2f48406aad unit tests for most of the StackVM opcodes. Fixed some opcode behaviors. 2018-09-21 02:20:37 +02:00
Irmen de Jong
455f60fb84 for loop and comparison expression fixes 2018-09-20 01:13:21 +02:00
Irmen de Jong
b72bd805e1 sub decl checking 2018-09-19 02:41:35 +02:00
Irmen de Jong
cba9e7670e added floordivision operator // 2018-09-19 01:24:28 +02:00
Irmen de Jong
00d74551b3 fix for loop code generation.
added flt conversion function.
attempt at implementing break and continue.
var initializer value can be omitted for numeric vars (and default to 0)
subroutine return statement not needed when no return values.
2018-09-18 23:14:32 +02:00
Irmen de Jong
63492a1805 stackvm functions 2018-09-18 00:38:29 +02:00
Irmen de Jong
54aeee2676 for translation improvements 2018-09-17 22:22:41 +02:00
Irmen de Jong
dd96ef8ef2 simple for loop (with constant ranges) is now compiled 2018-09-16 22:00:19 +02:00
Irmen de Jong
326e5cd81a restructure compiler 2018-09-16 20:36:02 +02:00
Irmen de Jong
88a9f2d493 stackvm program tweaks 2018-09-16 17:48:13 +02:00
Irmen de Jong
719a446d19 syntaxcheck for loop 2018-09-16 16:37:28 +02:00
Irmen de Jong
004776d0d8 added char symbols in petscii source code 2018-09-16 16:07:35 +02:00
Irmen de Jong
3c7a233b43 improved handling of range and range type checks 2018-09-16 15:40:28 +02:00
Irmen de Jong
2591f4e27e forloop in grammar 2018-09-16 03:00:32 +02:00
Irmen de Jong
1a40a88103 added remainder operator '%' 2018-09-16 00:59:12 +02:00
Irmen de Jong
3426593a06 fixed a load of type checks regarding arrays and matrixes and strings
added more builtin functions to the compiler to access the syscalls in the stackVm
2018-09-16 00:06:06 +02:00
Irmen de Jong
c05cd72d23 vm tweaks 2018-09-15 18:43:23 +02:00
Irmen de Jong
e382be89db changed source file suffix to .p8 2018-09-15 16:35:15 +02:00
Irmen de Jong
8ff72167a4 renamed project to Prog8 2018-09-15 16:21:05 +02:00