Commit Graph

1765 Commits

Author SHA1 Message Date
Irmen de Jong
efd7d6f0c0 tweak IR call args setting now via special SETPARAM instruction 2023-04-14 02:10:39 +02:00
Irmen de Jong
7c1d5cadd7 fix sort and reverse on strings on 6502 codegen 2023-04-10 19:33:24 +02:00
Irmen de Jong
dd1592b03b ir syscalls args via stack instead of fixed r65500+ 2023-04-10 18:02:37 +02:00
Irmen de Jong
9b952fbc44 tweaking IR instruction set branch instructions 2023-04-09 22:17:19 +02:00
Irmen de Jong
5665a7f0cb also track ir reg types 2023-04-07 22:24:17 +02:00
Irmen de Jong
4a0f15eb88 some loose ends 2023-04-06 21:19:21 +02:00
Irmen de Jong
d8214d4f12 fix IR array indexing for newexpr 2023-04-03 03:13:35 +02:00
Irmen de Jong
47d0f0ea40 implement missing operators in IR code gen 2023-04-01 02:29:33 +02:00
Irmen de Jong
d936568b76 added divmod() and divmodw() builtin functions to efficiently compute division and remainder in a single call 2023-03-29 23:46:44 +02:00
Irmen de Jong
01461a196d implementing optimized comparisons 2023-03-25 00:08:21 +01:00
Irmen de Jong
04832f052a working on doing comparison codegen differently 2023-03-25 00:08:21 +01:00
Irmen de Jong
1b81c7fb22 fix warnings 2023-03-24 22:50:01 +01:00
Irmen de Jong
a7df4dcf25 added cx16 bubbleuniverse example 2023-03-24 01:59:00 +01:00
Irmen de Jong
8e56a61f95 tweak 2023-03-20 22:41:58 +01:00
Irmen de Jong
d265271148 fix rpn variable depth clobber and type error 2023-03-20 22:18:10 +01:00
Irmen de Jong
b40e397b28 fix rpn result type mismatch 2023-03-20 00:58:48 +01:00
Irmen de Jong
df2d7d4734 fix RPN comparison exprs 2023-03-19 16:08:48 +01:00
Irmen de Jong
374464a1f8 weird condition operator... 2023-03-19 01:32:20 +01:00
Irmen de Jong
6e4ae034b2 more Rpn optimizations 2023-03-19 00:48:12 +01:00
Irmen de Jong
52b560e72d more Rpn optimizations 2023-03-18 19:13:32 +01:00
Irmen de Jong
9b971ad222 fix PeekW and PokeW optimizations 2023-03-18 17:36:32 +01:00
Irmen de Jong
3613162d09 fix RPN string comparisons 2023-03-18 16:55:03 +01:00
Irmen de Jong
3a272e998d Merge branch 'master' into rpn-expressions 2023-03-18 14:42:38 +01:00
Irmen de Jong
d4c750beb4 fix cx16/bdmusic and sincos examples 2023-03-18 14:42:15 +01:00
Irmen de Jong
94c06e13f4 implementing Rpn optimizations 2 2023-03-18 12:43:45 +01:00
Irmen de Jong
e8bebe5a75 implementing Rpn optimizations 2023-03-18 01:13:02 +01:00
Irmen de Jong
9241479da4 add "-rpn" command line switch to transform exprs to RPN in codegen 2023-03-17 22:28:22 +01:00
Irmen de Jong
92276b5769 IR fix unneeded register allocated for array indexing with variable 2023-03-14 21:24:44 +01:00
Irmen de Jong
592f74124c fix startup subroutine linking in VM 2023-03-12 16:09:55 +01:00
Irmen de Jong
f350137a14 fix array in place assignments
fixes balls and snow examples amongst others
2023-03-10 04:07:50 +01:00
Irmen de Jong
6c34672549 array in-place assignment problem 2023-03-10 02:02:47 +01:00
Irmen de Jong
6e9025ebf2 cx16 fix irq statusbit handling and kefrenbars example 2023-03-03 21:58:08 +01:00
Irmen de Jong
3922691b3c limit to 48828 hz sample rate (vera max) 2023-03-03 18:04:21 +01:00
Irmen de Jong
0545b77cf4 ask for filename 2023-03-03 17:24:16 +01:00
Irmen de Jong
6b3f39fa1a oops 2023-03-03 17:17:19 +01:00
Irmen de Jong
3114ab87dc add 8 bit sample width support 2023-03-03 17:12:44 +01:00
Irmen de Jong
00bc99cc7b added cx16/stream-wav example, refactor pcmaudio code 2023-03-03 14:18:13 +01:00
Irmen de Jong
ded2483fc0 cx16 startup code now properly turns off mouse cursor 2023-02-27 23:35:42 +01:00
Irmen de Jong
e62ea388e0 tweak cx16 adpcm example 2023-02-24 01:38:03 +01:00
Irmen de Jong
d9e4f39ddc memset BSS section to zero all at once, less individual var=0 assigns 2023-02-21 00:26:21 +01:00
Irmen de Jong
92a07b87d2 clearer 2023-02-20 02:32:36 +01:00
Irmen de Jong
adc15c24ef introduce bss segments 2023-02-19 18:12:37 +01:00
Irmen de Jong
9ca6860ffa tweak 2023-02-19 15:08:16 +01:00
Irmen de Jong
86c22636eb Merge branch 'master' into codegen-on-new-ast 2023-02-09 23:05:54 +01:00
Irmen de Jong
fe29d8a23f tweak codegen of inline sub 2023-02-09 21:59:09 +01:00
Irmen de Jong
7b59bc8d12 avoid division by zero if host fs hyperload is used which loads instantly 2023-02-08 01:37:49 +01:00
Irmen de Jong
c75b1581d2 lookup via new ST 2023-02-05 01:15:23 +01:00
Irmen de Jong
109e118aba fix sub return register 2023-02-03 21:16:44 +01:00
Irmen de Jong
e94319145f test 2023-01-26 01:41:44 +01:00
Irmen de Jong
48c9349ce9 working on codegen fixes 2023-01-25 01:57:25 +01:00
Irmen de Jong
99c62aab36 Merge branch 'master' into codegen-on-new-ast
# Conflicts:
#	examples/test.p8
2023-01-24 01:51:20 +01:00
Irmen de Jong
74b69e191e restructure keyboardhandler example due to X register bug, discussed in #94 2023-01-24 01:30:57 +01:00
Irmen de Jong
8cda8a727c update vtui example to vtui 1.0 2023-01-24 01:00:21 +01:00
Irmen de Jong
4403e4ed62 optimize node renames 2023-01-22 18:26:37 +01:00
Irmen de Jong
9b209823f6 simple test 2023-01-22 17:10:52 +01:00
Irmen de Jong
4e103a1963 making snow example more interesting 2022-12-22 13:04:26 +01:00
Irmen de Jong
bf0604133c fix error in IR for inline asm and BSS vars. 2022-12-04 16:48:44 +01:00
Irmen de Jong
a82b2da16e Fix some FP related assignment issues in 6502 codegen. 2022-12-04 13:03:38 +01:00
Irmen de Jong
17bedac96c vm: memory is randomized on start instead of 0. P8ir file now has BSS segment. Vm clears BSS vars to 0. 2022-12-03 17:46:06 +01:00
Irmen de Jong
f470576822 it's now possible to use symbols that are the same name as 6502 instructions
because these are now prefixed internally before generating assembly.
2022-11-30 18:39:56 +01:00
Irmen de Jong
10760a53a8 optimize cmp word equal/notequal 2022-11-29 20:14:35 +01:00
Irmen de Jong
eee805183c don't overwrite temp vars in complex comparison expressions. Fixes #89 2022-11-29 04:13:25 +01:00
Irmen de Jong
b8fb391022 - ir codegen now allows subroutine having the same name as its block
this is not possible for the 6502 codegen due to 64tass scoping limitation
2022-11-28 21:54:33 +01:00
Irmen de Jong
3c698f1584 fileseek for writing not right now 2022-11-27 21:52:18 +01:00
Irmen de Jong
2fad52d684 the adpcm example can now read wav files directly (so no need anymore to extract the binary frame data from them) 2022-11-27 21:37:40 +01:00
Irmen de Jong
ec64a68a71 fixed compiler crash: unsigned = (-(unsigned as word) as uword) 2022-11-27 17:25:47 +01:00
Irmen de Jong
db55562f6a fixed adpcm playback 2022-11-27 16:36:30 +01:00
Irmen de Jong
0d0ce6eec1 adpcm plays pcm 2022-11-24 21:03:50 +01:00
Irmen de Jong
7b6c742178 fixed diskio.f_read() for small read sizes 2022-11-24 00:23:37 +01:00
Irmen de Jong
f870e4965a added cx16diskio.f_seek() function to seek to a position in an opened file
f_open uses channel 12 now, f_open_w uses 13
2022-11-23 01:48:04 +01:00
Irmen de Jong
c21913a66b ir: keep order of children in block 2022-11-22 02:04:24 +01:00
Irmen de Jong
153b422496 cx16: retain display mode (composite etc) 2022-11-20 19:19:01 +01:00
Irmen de Jong
d8e87bd881 make uword xx = 1<<shift into a word shifting 2022-11-16 01:39:34 +01:00
Irmen de Jong
922033c1b2 main block element order now remains the same as in source 2022-11-16 00:32:00 +01:00
Irmen de Jong
836a2700f2 func(x>>1) no longer uses slow stack eval 2022-11-15 02:49:40 +01:00
Irmen de Jong
00c059e5b1 adding cx16/adpcm example 2022-11-15 01:17:28 +01:00
Irmen de Jong
f4f355c74a added cx16/diskspeed example 2022-11-14 17:55:55 +01:00
Irmen de Jong
2d78eaa48d fix gfx2 text color, added cx16 snow example 2022-11-12 22:08:07 +01:00
Irmen de Jong
9d7b9771c2 p8ir file format is now valid XML 2022-11-11 23:35:52 +01:00
Irmen de Jong
3dcf628fdb fixed subroutine name shadow check 2022-11-10 22:51:37 +01:00
Irmen de Jong
e614e9787a ir: write values as hex into p8ir file 2022-11-08 21:59:05 +01:00
Irmen de Jong
5d4bfffc7e float.rndseedf() now takes float seed value and is consistent for all CBM compilation targets 2022-11-06 22:53:57 +01:00
Irmen de Jong
207cdaf7a4 fix kefrenbars example (use gfx2 instead of kernal routines) 2022-11-06 17:33:30 +01:00
Irmen de Jong
7315b581ce added gfx2.pget(x,y) to get the pixel color value 2022-11-06 13:40:55 +01:00
Irmen de Jong
38efaae7b2 ir/vm: syscall params in high base register to avoid push/pop 2022-11-06 12:52:09 +01:00
Irmen de Jong
469e042216 vm: replaced prog8_lib.string_compare and others with syscalls 2022-11-04 23:12:13 +01:00
Irmen de Jong
0f1a4b9d8f fixed certain type check error when passing boolean value to ubyte function parameter
fixed virtual machine string comparison syscall
2022-11-03 23:06:03 +01:00
Irmen de Jong
7303c00296 vm: prog8lib.wordarray_contains() fixed 2022-11-03 22:48:47 +01:00
Irmen de Jong
562d722ad5 codegen: added missing codegen for float array inplace modification 2022-11-03 20:08:46 +01:00
Irmen de Jong
144c1ba3a6 ir: fix float instruction value in formatspec 2022-11-03 19:08:38 +01:00
Irmen de Jong
dc0edc4c2b break also in for 2022-10-29 23:34:59 +02:00
Irmen de Jong
434515d957 fix: array[x] = ~array[x] no longer crashes the codegen 2022-10-27 23:56:38 +02:00
Irmen de Jong
e9a4a905ef preparing to fix the array indexing compiler issue 2022-10-26 23:53:17 +02:00
Irmen de Jong
e94bf4c63c replace rnd()/rndw() builtin functions by regular routines in math module 2022-10-22 17:02:43 +02:00
Irmen de Jong
ec5adffdc2 rnd()/rndf() routines can now be seeded with new rndseed()/rndseedf() routines. fixes #80 2022-10-22 13:34:22 +02:00
Irmen de Jong
53b0b562e6 fix check for routine that returns multiple values but in status bit. Fixes #79 2022-10-19 23:23:49 +02:00
Irmen de Jong
39d6d2857e ir: change inline binary a bit 2022-10-04 00:57:08 +02:00
Irmen de Jong
af6be44676 ir: adding register usage inspections
fix compiler problems with untrimmed inlined asm, and when only a single return statement is present in a subroutine
2022-09-30 20:25:00 +02:00
Irmen de Jong
5a8f97a0b6 ir: adding last missing features to be able to encode all of Prog8 2022-09-30 16:01:00 +02:00
Irmen de Jong
0d4dd385b8 added '%ir' to write inline IR code, '%asm' is now only for real 6502 assembly.
(%ir is probably only used in the library modules for the virtual machine target)
2022-09-30 15:12:26 +02:00