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
Irmen de Jong
7c1bdfe713
ir: uninitialized vars remain empty, bss section classifier (unused for now as there are no segements yet)
2022-09-28 16:56:50 +02:00
Irmen de Jong
e7a3a89bfb
fix windows issue
2022-09-27 22:41:48 +02:00
Irmen de Jong
1d2ce2cbeb
consolidate IR line parse function
2022-09-27 18:02:57 +02:00
Irmen de Jong
1a56743bb1
fix IR repeat loop codegen when amount is 0
2022-09-25 20:48:17 +02:00
Irmen de Jong
dda19c29fe
vm: fix symbols to be case sensitive properly in p8virt assembler
2022-09-25 15:51:50 +02:00
Irmen de Jong
0e1886e6bd
vm: fix nested label prefixing
2022-09-24 16:00:25 +02:00
Irmen de Jong
c26e116f0e
vm: fix crashes when array contains pointers/strings
2022-09-24 14:42:07 +02:00
Irmen de Jong
5c9c7f2c5e
adding more complex vm examples
2022-09-23 14:56:06 +02:00
Irmen de Jong
ca2fb6cef3
IR no longer depends on VM syscalls but has its own syscall list for the few builtin functions that still require it
2022-09-23 14:27:51 +02:00
Irmen de Jong
46dac909ef
vm/math.p8: complete the sin and cos routines
2022-09-22 15:49:19 +02:00
Irmen de Jong
b1e4347e10
fix compiler crash sometimes when casting byte to word
2022-09-22 13:00:47 +02:00
Irmen de Jong
97aa91c75e
removed 16 bits sin/cos routines from math library (sin16, sin16r etc)
2022-09-22 12:55:00 +02:00
Irmen de Jong
11d87e4725
VM: support cpu registers
2022-09-19 17:13:46 +02:00
Irmen de Jong
627ed51a1b
IR: mem mapped vars and memory slabs
2022-09-19 15:20:40 +02:00
Irmen de Jong
2f3e7d1c27
IR support for storing incbins and romsubs
2022-09-17 16:07:41 +02:00
Irmen de Jong
0e831d4b92
fix superfluous usage of addressOf()
2022-09-16 00:31:04 +02:00
Irmen de Jong
6428ced157
added subroutine params to IRSubroutine
2022-09-13 23:06:05 +02:00
Irmen de Jong
30a42ec1bd
IR tweak
2022-09-13 23:06:05 +02:00
Irmen de Jong
aacea3e9db
incbin in IR
2022-09-13 23:06:05 +02:00
Irmen de Jong
6886b61186
also output inline asm chunks
2022-09-13 23:06:05 +02:00
Irmen de Jong
0744c9fa29
properly flatten label names for the IR code
2022-09-13 23:06:05 +02:00
Irmen de Jong
502a665ffc
getting address-of into IR without allocations
2022-09-13 23:06:05 +02:00
Irmen de Jong
3c315703c0
making IR file reader
2022-09-13 23:06:05 +02:00
Irmen de Jong
12ed07a607
comments
2022-09-13 23:06:05 +02:00
Irmen de Jong
97f4316653
rename IR classes
2022-09-13 23:06:05 +02:00
Irmen de Jong
a182b13e5a
fixup for memoryslabs
2022-09-13 23:06:05 +02:00
Irmen de Jong
80b630a1e4
added memoryslabs to symboltable
2022-09-13 23:06:05 +02:00
Irmen de Jong
475efbe007
steps to make actual IR based on VM code. For now, as experimental codegen.
2022-09-13 23:06:05 +02:00
Irmen de Jong
c6c5ff2089
added joystick controls to cx16 tehtriz
2022-08-23 18:11:35 +02:00
Irmen de Jong
176ec8ac7d
fix 6502 codegen bug: complex comparison expression is evaluated wrong.
...
Fixed by reintroducing splitting of comparison expression in if statements by using a temporary variable and/or register to precompute left/right values.
2022-08-23 00:05:57 +02:00
Irmen de Jong
dcdd4b3255
found bug in comparison expr codegen
2022-08-22 23:16:56 +02:00
Irmen de Jong
fc0a0105b3
move memoryslab administration from allocator to symboltable
2022-08-21 19:48:56 +02:00
Irmen de Jong
6454bf8ec4
added mouse cursor to amiga example
...
slightly sped up text rendering in gfx2 highres mode
2022-08-16 04:25:59 +02:00
Irmen de Jong
7ef4ddf0f3
fixed operator precedence: bitwise must come before comparisons
2022-08-14 12:34:00 +02:00
Irmen de Jong
d8e18df3a1
added c64 starfield example
2022-08-14 12:02:23 +02:00
Irmen de Jong
0aa0ec5abd
fix c64 zeropage locations of cx16 virtual registers
2022-08-13 00:14:19 +02:00
Irmen de Jong
b6eef3612f
added some ported bench8 test programs
2022-08-12 22:08:27 +02:00
Irmen de Jong
44ee4b989f
optimize code for logical expressions more if right operand is simple
2022-08-12 00:49:40 +02:00
Irmen de Jong
18790d867c
optimize conditional expression WORD & $ff00 to just msb(WORD)&$ff
2022-08-12 00:21:44 +02:00
Irmen de Jong
d6b8936376
fix mkword(@(ptr), 0) wrong asm
2022-08-11 23:01:19 +02:00
Irmen de Jong
4d840c7db8
optimized mkword(0, X)
2022-08-11 22:51:09 +02:00
Irmen de Jong
4d2b21816d
optimized uword <<8 and >>8
2022-08-11 22:25:15 +02:00
Irmen de Jong
2d34fdd28f
in a block marked option force_output, make all subroutines in asm use .block rather than .proc
...
this fixes some obscure assembly issues where subroutines were omitted from the output program by 64tass
2022-08-10 21:28:40 +02:00
Irmen de Jong
68abda1219
fix a few small compiler errors (removing functioncall, removing block, assigning virtual register return value)
2022-08-09 23:38:29 +02:00
Irmen de Jong
f778f08f76
tweak
2022-08-08 21:09:49 +02:00
Irmen de Jong
ac1bd2fb7b
virtual: properly output "memmapped" variables too
...
still as regular variables though
2022-08-08 20:42:17 +02:00
Irmen de Jong
4b7b1379d9
also binexpr split on and,or,xor if appropriate
2022-08-08 00:09:18 +02:00
Irmen de Jong
1e441c2ddf
tweak vm codegen
2022-08-07 13:45:03 +02:00
Irmen de Jong
f718f4251b
working on better encoding of romsub in new ast/vmtarget
2022-08-07 12:21:10 +02:00
Irmen de Jong
197081f10d
keyboardhandler
2022-08-04 23:04:16 +02:00
Irmen de Jong
00b717cde8
tweak
2022-08-04 18:35:10 +02:00
Irmen de Jong
a0deb463c9
optimized codegen for some equality comparison expressions and some logical expressions
2022-07-31 15:25:54 +02:00
Irmen de Jong
90ddec2ad8
avoid multiple change events in watch mode
...
added bsieve example
2022-07-31 11:58:27 +02:00
Irmen de Jong
f531daa872
on C64, the cx16.r0...cx16.r15 virtual regs are now in zeropage as well when using kernalsafe or full
2022-07-28 19:13:33 +02:00
Irmen de Jong
046dceb5c2
added optimized case for signed division by 2
2022-07-24 13:59:35 +02:00
Irmen de Jong
dcc1f00048
fix rounding errors in signed divide by power-of-two
...
The optimized bit-shifting division is removed (for now)
2022-07-24 12:34:55 +02:00
Irmen de Jong
05f935b598
simplify & fix recursion detector
2022-07-22 22:22:43 +02:00
Irmen de Jong
aeabf0f324
nicer colors
2022-07-17 21:37:15 +02:00
Irmen de Jong
7d4695c5b2
cx16: graphics module y resolution corrected from 200 to 240. added 'cx16/circles' example.
2022-07-17 18:59:52 +02:00
Irmen de Jong
8e1071aa89
fix compiler crashes: txt.chrout("a"), uword[] a = ["ls", subroutine] without & before subroutine.
2022-07-15 23:17:03 +02:00
Irmen de Jong
f690f58bd4
callfar() now accepts a variable as address, so it can be used to indirect JSR to a subroutine whose address is not fixed. ('goto' already could indirect JMP to a variable address.)
2022-07-14 19:29:59 +02:00
Irmen de Jong
2d600da8b6
fix codegen crash on certain nested typecast
2022-07-13 22:24:31 +02:00
Irmen de Jong
35af53828a
fix endless loop in optimizer, fix cx16 register clobbering in psg interrupt handler, fix crash on certain arrays, fix undefined symbol when it's in another imported module
2022-07-13 18:42:06 +02:00
Irmen de Jong
10ddd5b127
fixed missing non-boolean operand cast in logical expressions
2022-07-12 22:28:06 +02:00
Irmen de Jong
edf12bec71
improve bool params typecasting, fix compiler crash on abs(floatvar)
2022-07-12 17:52:37 +02:00
Irmen de Jong
ff1fc28287
added immediate value vm logical instructions because these are so common
2022-07-12 16:12:32 +02:00
Irmen de Jong
314398ba4c
added immediate value vm arithmetic instructions because these are so common
2022-07-12 15:21:26 +02:00
Irmen de Jong
68da661edc
optimize comparison to true/1 into comparison to zero, optimize while/until conditions
2022-07-11 16:42:52 +02:00
Irmen de Jong
88cbb6913d
tweak bool type handling
2022-07-11 14:55:50 +02:00
Irmen de Jong
7a26646e1b
tweak bool type handling
2022-07-11 02:08:12 +02:00
Irmen de Jong
fb63434eee
tweak maze example
2022-07-09 22:13:30 +02:00
Irmen de Jong
97f90d9684
Merge branch 'master' into bool_type
2022-07-09 22:09:49 +02:00
Irmen de Jong
f91786367f
added maze example
2022-07-09 22:00:46 +02:00
Irmen de Jong
211e2bb37a
improved bool type checking
2022-07-08 22:29:13 +02:00
Irmen de Jong
d2d08bf143
fix compiler error about bool vs ubyte
2022-07-08 22:03:05 +02:00
Irmen de Jong
8acb37b6c2
use bool type in examples and libraries
2022-07-08 21:50:32 +02:00
Irmen de Jong
81b3d2db4f
fix compiler crash
2022-07-08 21:50:06 +02:00
Irmen de Jong
1dfa8ee7d8
add ARRAY_BOOL array type
2022-07-07 23:07:30 +02:00
Irmen de Jong
1163543a98
fix bool param lookup problem
2022-07-07 22:23:56 +02:00
Irmen de Jong
bdb7de34be
added several compiler checks against weird boolean type use in expressions
2022-07-07 22:23:56 +02:00
Irmen de Jong
9500fc11ac
document new bool datatype and removal of boolean() conversion function
2022-07-07 22:23:56 +02:00
Irmen de Jong
41f4e22a17
introduce BOOL type
2022-07-07 22:23:56 +02:00
Irmen de Jong
ea2812f50f
add max volume to psg envelope
2022-07-03 11:26:56 +02:00
Irmen de Jong
3ec05709d5
convert the sounds in cx16 tehtriz to use the psg module instead
2022-07-03 01:40:29 +02:00
Irmen de Jong
4bdac7404a
added sustain to psg envelope
2022-07-03 00:55:25 +02:00
Irmen de Jong
cc41218d37
added nicer vm example
2022-07-03 00:41:04 +02:00
Irmen de Jong
7a3745f642
psg tweaks
2022-07-02 20:33:40 +02:00
Irmen de Jong
f8658f6afa
precalc vera freq to not use floating point math anymore
2022-07-02 19:40:18 +02:00
Irmen de Jong
223b725a10
psg abstraction and attack/release envelope
2022-07-02 18:47:12 +02:00
Irmen de Jong
25aad8d7be
improve const-evaluation of builtin expressions
2022-07-02 16:29:01 +02:00
Irmen de Jong
b2c9b7635d
revert restriction on certain associative operator reshuffling
...
it caused larger generated code
2022-07-02 13:59:24 +02:00
Irmen de Jong
24d13dd120
fix problematic optimizations to logical expressions
2022-07-02 00:56:24 +02:00
Irmen de Jong
965340ff90
logical and/or/xor/not all replaced by bitwise &,|,^,~ (ast, codegens)
...
this also fixed some invalid outcomes of logical expressions!
2022-07-02 00:38:17 +02:00
Irmen de Jong
8e36fe6bef
temporary workaround for code problem around 'not'
2022-07-01 01:01:15 +02:00
Irmen de Jong
f675dbc726
vm var allocator now also recognises the memory-mapped variables. no longer crashes
2022-06-30 22:09:49 +02:00
Irmen de Jong
2ad4fdbbb9
added cx16 version of bdmusic, needs ADSR though
2022-06-30 21:33:48 +02:00
Irmen de Jong
97cb0cbd08
tweak "not" removal/rewriting
2022-06-30 02:16:30 +02:00
Irmen de Jong
ef92451d1a
fix logical expressions on arbitrary values, for now with boolean() around the operands
2022-06-28 01:18:36 +02:00
Irmen de Jong
06184bdcb1
get rid of failed mccarthy shortcut evaluation
2022-06-27 21:44:52 +02:00
Irmen de Jong
af98d01053
failed attempt at McCarthy shortcut evaluation
2022-06-27 21:40:48 +02:00
Irmen de Jong
bb1cda0916
fix: boolean values of terms in logical expressions are now properly evaluated
2022-06-26 23:55:34 +02:00
Irmen de Jong
a6d0ea347c
bank caching not required for pcm_play()
2022-06-26 22:08:10 +02:00
Irmen de Jong
0fcd57192b
cx16diskio.f_read() now correctly deals with banked ram boundary
2022-06-26 21:42:56 +02:00
Irmen de Jong
5656ec11d3
fix missing abs(byte) routine
2022-06-24 01:51:54 +02:00
Irmen de Jong
eb53e44cb0
zsound stream test
2022-06-24 01:51:33 +02:00
Irmen de Jong
8ab99f6129
zsound combo example
2022-06-21 00:38:59 +02:00
Irmen de Jong
bda016bb3b
optimized 6502 codegen for logical expressions
2022-06-15 22:17:15 +02:00
Irmen de Jong
cc174b7b85
added boolean() builtin function and use it to get rid of !=0 comparisons
2022-06-14 23:34:45 +02:00
Irmen de Jong
775c85fc18
don't swap operands that would change function evaluation order + vm: fix label casing error
2022-06-13 00:25:45 +02:00
Irmen de Jong
5a756aaed9
Pipe expression "|>" removed from the language
2022-06-12 18:41:42 +02:00
Irmen de Jong
dca092fd7c
fix pipe expression when start term is constant number
2022-06-12 16:59:28 +02:00
Irmen de Jong
c6e92ecac4
some code cleanup
2022-06-12 16:15:08 +02:00
Irmen de Jong
93008ff605
tweak zsound examples
2022-06-12 14:51:24 +02:00
Irmen de Jong
43c7b935df
fixed zsound pcm player example
2022-06-11 03:31:42 +02:00
Irmen de Jong
8f9a0a244a
trying to add zsound pcm player example as well
2022-06-10 23:35:37 +02:00
Irmen de Jong
fd13bd864e
some notes added to zsound demo player
2022-06-09 23:36:07 +02:00
Irmen de Jong
f537793b0b
added zsound demo player example (cx16)
2022-06-08 23:57:01 +02:00
Irmen de Jong
f7183e38ee
tweak trivial subroutine inlining
2022-06-08 21:05:03 +02:00
Irmen de Jong
0a65dfdd10
optimized codegen for some more simple expressions with +/-
2022-06-07 22:30:08 +02:00
Irmen de Jong
3075578245
optimized codegen for assigning value or variable to indexed pointer. (6502)
2022-06-06 18:30:19 +02:00
Irmen de Jong
b042b7705e
fix invalid removal of repeated assignments.
2022-06-06 17:27:06 +02:00
Irmen de Jong
3054a1d32d
api change: removed swap() builtin function (too complex in codegen for little used function)
2022-06-06 16:01:11 +02:00
Irmen de Jong
0a3cd652b0
vm: fix codegen for storing to pointer indexed
2022-06-06 14:18:12 +02:00
Irmen de Jong
f70b914779
fix optimized codegen for 2 arg functions, sometimes was passing wrong arg value due to register overwriting
2022-06-06 13:21:45 +02:00
Irmen de Jong
46ca0ac10d
properly optimize X - -1 and X + -1, this also fixes type change of ubyte - 2 + 10
2022-06-05 15:35:29 +02:00
Irmen de Jong
031f647952
allow casting negative numbers to unsigned, result = 2's complement
2022-06-05 14:21:10 +02:00
Irmen de Jong
dbb92881a1
fixed X register corruption in some cases of rol() and ror()
2022-06-04 21:10:48 +02:00
Irmen de Jong
10bf7f5d07
fix: again gives proper name redefinition errors in same scope
2022-06-04 20:15:46 +02:00
Irmen de Jong
1e61d84fd1
vm: fix expression codegen for pointer indexing
2022-06-04 19:32:35 +02:00
Irmen de Jong
2002412026
optimized codegen for pointer indexing (read expressions)
2022-06-04 17:20:17 +02:00
Irmen de Jong
7f69517fd4
preparing optimizing pointer indexing
2022-06-04 16:18:27 +02:00
Irmen de Jong
c40cfaa388
preparing optimizing pointer indexing
2022-06-04 14:23:02 +02:00
Irmen de Jong
5fe6aa2800
fix swap() code for pointervars
2022-06-03 23:13:35 +02:00
Irmen de Jong
b459b09b2f
vm: fix comparison datatype error; primes.p8 works again
2022-05-24 18:26:07 +02:00
Irmen de Jong
3f5877dbcc
vm: fix array iteration
2022-05-23 21:24:36 +02:00
Irmen de Jong
e659b91c4d
vm: fix storezm/storezx instructions
2022-05-23 21:01:02 +02:00
Irmen de Jong
b646f50265
vm: implemented in-memory bit shift instructions
2022-05-23 20:15:20 +02:00
Irmen de Jong
0a48ef3030
vm: just use new register instead of trying to (ab)use reg 0
2022-05-22 23:38:46 +02:00
Irmen de Jong
ba614801ee
cleanup
2022-05-22 23:11:22 +02:00
Irmen de Jong
fd6eb47e68
added inlining certain trivial non-asm subroutine calls
2022-05-22 20:22:09 +02:00
Irmen de Jong
e69aeb8b98
added warning about shadowing variables
2022-05-22 17:34:08 +02:00
Irmen de Jong
26ea1da146
vm: add in-place bitwise or,and,xor
2022-05-20 20:50:27 +02:00
Irmen de Jong
461b6499ef
vm: add in-place add/sub
2022-05-19 22:54:50 +02:00
Irmen de Jong
c769920b6e
vm: fix signed divide
2022-05-19 22:24:57 +02:00
Irmen de Jong
181b98ef9e
vm: implemented some self-assign instructions
2022-05-18 22:15:42 +02:00
Irmen de Jong
4e1184a400
vm: added some of the sin cos tables in math.p8
2022-05-17 22:56:00 +02:00
Irmen de Jong
e52d9e3210
vm: split off assignment codegen to its own file
2022-05-17 22:38:31 +02:00
Irmen de Jong
dc6475c91b
vm: fixed non-byte array indexing
2022-05-17 18:53:33 +02:00
Irmen de Jong
0bf00d1ca4
c64/c128 targets: perform cleanup at program exit such as re-enabling run-stop key and character set switching.
2022-05-15 16:44:26 +02:00
Irmen de Jong
d1a707df57
fix assigning a pointer (uword) to string not copying the correct memory
2022-05-15 16:10:58 +02:00
Irmen de Jong
4dc9b45297
vm: fixed string comparisons, added missing vm string module
2022-05-13 23:10:13 +02:00
Irmen de Jong
6e31eebfb5
vm: ifElse codegen uses proper branching instructions now
2022-05-12 21:26:17 +02:00
Irmen de Jong
a7df828932
vm: codegen uses INCM/DECM if possible
2022-05-12 19:40:31 +02:00
Irmen de Jong
517cf61d11
vm: limit int instructions to just 2 register args
2022-05-11 22:36:47 +02:00
Irmen de Jong
4be7bc8323
vm: limit float instructions to just 2 register args
2022-05-11 22:09:46 +02:00
Irmen de Jong
74c05d00a9
vm: fix comparison operator codegen for floats
2022-05-11 17:07:21 +02:00
Irmen de Jong
bacba629a5
vm: use shift-one instructions in codegen
2022-05-11 15:50:51 +02:00
Irmen de Jong
14e36f1362
vm: fix assignment to array
2022-05-11 15:26:54 +02:00
Irmen de Jong
d43ad849d1
vm: actually use the store-zero instructions in codegen
2022-05-11 15:18:36 +02:00
Irmen de Jong
627aa61184
clean up subroutine inlining, basis for new try
2022-05-09 15:42:58 +02:00
Irmen de Jong
fef52c0112
automatically convert multi-compare expression (if X==1 or X==2..) to contaiment check if X in [1,2,..]
2022-05-08 13:21:34 +02:00
Irmen de Jong
8c4765b386
vm: support non-unary functions in pipe expressions
2022-05-07 20:42:05 +02:00
Irmen de Jong
7c121bfc01
first steps to support multiple args in pipe expressions
2022-05-07 19:00:47 +02:00
Irmen de Jong
942c5cc04b
fix crash when optimizing pipe expression too aggressively
2022-05-07 17:29:36 +02:00
Irmen de Jong
348b3036ff
now correctly accepts "xxx" * constexpr (where constexpr is not just a single const number)
2022-05-05 23:21:20 +02:00
Irmen de Jong
09d3451d9d
vm: accept %asmbinary (but it is eventually ignored in code execution)
2022-05-05 21:43:31 +02:00
Irmen de Jong
b1a49e5f29
vm: implement rest of float instructions
2022-05-04 22:31:45 +02:00
Irmen de Jong
da01a5b4dc
vm: implement float to integer cast, any, all, reverse
2022-05-04 22:08:21 +02:00
Irmen de Jong
3f9cdd9b56
vm: fix mul and div instructions
2022-05-04 01:10:59 +02:00
Irmen de Jong
0f9e87d7bb
fixed compiler crash when casting float to integer, fixed float to int cast value error on cx16
2022-05-03 23:43:38 +02:00
Irmen de Jong
0869789214
vm: implement float type casts to integer types
2022-05-02 23:38:32 +02:00
Irmen de Jong
10c8cc35c5
vm: implement float divide multiply sub add
2022-05-02 21:53:43 +02:00
Irmen de Jong
30c2e3e8ff
vm: fix comparisons codegen
2022-05-02 21:32:45 +02:00
Irmen de Jong
86cc2f1075
vm: implementing more fp instructions
2022-05-02 21:06:14 +02:00
Irmen de Jong
b32641db87
remove syscall() builtin functions
...
vm code can do this via inline assembly
2022-05-01 00:41:30 +02:00
Irmen de Jong
0ee790969d
vm: allow inline "assembly"
2022-04-30 23:24:25 +02:00
Irmen de Jong
7844ace934
vm: implementing floating-point
2022-04-29 22:27:02 +02:00
Irmen de Jong
0fab806f36
vm: some preparations for floating point
2022-04-27 17:45:58 +02:00
Irmen de Jong
be2113d291
vm: starting to implement floating point instructions
2022-04-26 21:25:59 +02:00
Irmen de Jong
625d5b2313
vm: some preparations for floating point
2022-04-26 21:08:32 +02:00
Irmen de Jong
cf50e4f6ec
vm: printing of numbers now via conv module.
...
assigning strings now converted to strcopy function call in the compiler ast.
2022-04-23 02:15:51 +02:00
Irmen de Jong
7eea97d741
- floats: remove all floating point builtin functions and move them to the floats module instead
2022-04-22 00:45:54 +02:00
Irmen de Jong
88b55ab93e
vm: add abs() and fix 6502 abs() code.
2022-04-18 21:20:17 +02:00
Irmen de Jong
ee36d47c27
vm: added cmp() and most of the status-branch instructions
2022-04-18 19:59:48 +02:00
Irmen de Jong
0f36be0001
vm: simple optimizations for +/-/*/div with constants
2022-04-14 22:42:25 +02:00
Irmen de Jong
0f4a197e34
improve ast check on pipe expressions
2022-04-14 00:49:06 +02:00
Irmen de Jong
7dbff5b9e6
abs: remove support for floats. Use floats.fabs() instead.
...
this solves: can't use abs() etc in pipe expression because return type depends on argument type
2022-04-14 00:38:31 +02:00
Irmen de Jong
220246278a
removed sum(), max(), min(). abs() now always returns uword type.
...
This greatly simplifies internal handling of builtin functions by always having one fixed return type.
2022-04-14 00:21:16 +02:00
Irmen de Jong
349e5a15e9
min/max give proper error for string args
...
als implmented more vm builtin functions/syscalls
2022-04-13 23:09:25 +02:00
Irmen de Jong
bf7f4bba7b
doc
2022-04-13 20:43:07 +02:00
Irmen de Jong
ab1766a559
moved all *integer* builtin trig functions (sin8u, cos8u etc) as regular asmsubs in math module
2022-04-13 00:27:35 +02:00
Irmen de Jong
51bf33040a
vm: add many builtin functions
2022-04-11 22:39:33 +02:00
Irmen de Jong
a2c7273801
vm: use memory load instruction better
2022-04-11 20:55:06 +02:00
Irmen de Jong
ec6ac5bf24
vm: added swap()
2022-04-11 01:50:47 +02:00
Irmen de Jong
ec7501782d
vm: added 1-bit variants of lsr/lsl opcodes
2022-04-11 00:25:00 +02:00
Irmen de Jong
890b1c2d52
more readable
2022-04-10 22:31:37 +02:00
Irmen de Jong
c25d07259a
add block directive options to PtBlock
2022-04-10 21:37:47 +02:00
Irmen de Jong
c960246eee
add some utility methods to PtNode to find the defining subroutine/block
2022-04-10 21:20:01 +02:00
Irmen de Jong
b6eb343234
moving string escaping out of antlr project
2022-04-10 17:31:30 +02:00
Irmen de Jong
a0face4a28
vm: implementing rol/ror
2022-04-09 11:13:49 +02:00
Irmen de Jong
a8cf9f5cc4
vm: syscalls can now return value
2022-04-05 20:46:34 +02:00
Irmen de Jong
8e4c0f7c22
vm: add sorting and reverse functions, fix value arg out of range errors
2022-04-05 17:48:49 +02:00
Irmen de Jong
d78bfcc35c
vm: more optimal code when array index is constant value
2022-04-05 00:19:37 +02:00
Irmen de Jong
2b7c09e6ee
vm: more optimal code for loops ending on 0
2022-04-05 00:08:38 +02:00
Irmen de Jong
036d9dbe59
got rid of unnecessary cast of boolean expressions by making their type dynamically adjust to byte or word
2022-04-04 23:43:55 +02:00
Irmen de Jong
1d342cc6af
optimize cx16 textio.setcc()/setcc2()
2022-04-04 22:23:06 +02:00
Irmen de Jong
62b32b2211
todos
2022-04-03 22:56:13 +02:00
Irmen de Jong
5b3ccab7dc
vm: support noreinit option
2022-04-03 17:19:50 +02:00
Irmen de Jong
d616cb283b
vm: implemented Pipe expression
2022-04-03 15:25:32 +02:00
Irmen de Jong
6ff56dc0bb
vm: implemented When
2022-04-02 19:04:12 +02:00
Irmen de Jong
1e63615592
tweaks
2022-04-02 18:04:41 +02:00
Irmen de Jong
b133d51a83
make the parser report '&&' as an error instead of treating it as bitwise and followed by address-of.
2022-04-02 02:08:01 +02:00
Irmen de Jong
20d06d9f9d
fix return type error for asmsubs with >1 result values
2022-04-01 22:30:15 +02:00
Irmen de Jong
e2886e5303
x16 r39: update vtui lib and example
2022-04-01 21:09:40 +02:00
Irmen de Jong
c6cf330e70
fix bug in codegen for containment check in bytearrays and strings
2022-04-01 20:46:28 +02:00
Irmen de Jong
f7431f809e
fix colorbars example issue with memcopy due to overlapping buffers
2022-04-01 00:54:06 +02:00
Irmen de Jong
ea43c34de8
x16 r39: fix screen colors after changing screen mode
2022-04-01 00:21:22 +02:00
Irmen de Jong
fb6e9fa58f
x16 r39: fix textio routines for new vera memory layout
2022-03-31 23:47:11 +02:00
Irmen de Jong
86a7200012
x16 r39: cx16.screen_set_mode() -> cx16.screen_mode()
2022-03-31 18:17:28 +02:00
Irmen de Jong
6ddb7453e1
vm postincrdecr on array done
2022-03-31 02:13:20 +02:00
Irmen de Jong
ad2355f8d3
vm forloop done
2022-03-31 01:41:59 +02:00
Irmen de Jong
0a0c58d450
added for loop over constant ranges
2022-03-30 23:42:15 +02:00
Irmen de Jong
0dc592b819
working on vm
2022-03-30 22:23:25 +02:00
Irmen de Jong
f46300016d
working on vm
2022-03-30 01:58:31 +02:00
Irmen de Jong
3e1a7c6102
fix vm signed comparisons
2022-03-29 00:57:33 +02:00
Irmen de Jong
f07065bf84
some x16 example changes to use the improved mode $80 screen resolution
2022-03-28 22:30:34 +02:00
Irmen de Jong
6d79903eb3
workin on vm issues
2022-03-28 01:49:43 +02:00
Irmen de Jong
bb1bf6a88c
working on vm
2022-03-28 00:40:15 +02:00
Irmen de Jong
30cbb6c9a8
implementing more of the vm
2022-03-27 21:59:46 +02:00
Irmen de Jong
4e33ab1e89
cx16 target: update float routine addresses to new r39 kernal FP package
2022-03-27 19:34:49 +02:00
Irmen de Jong
5494f309c0
working on vm
2022-03-27 17:46:15 +02:00
Irmen de Jong
3b6e7eccdd
simplified containment check, only possible on string and arrays (as per the docs)
2022-03-27 16:59:55 +02:00
Irmen de Jong
e41d6787bb
working on vm
2022-03-27 14:23:01 +02:00
Irmen de Jong
ed30108961
removed '**' power-operator. Use floats.pow() instead.
2022-03-27 13:16:34 +02:00
Irmen de Jong
12712ef812
working on vm
2022-03-27 11:48:44 +02:00
Irmen de Jong
0307f6b42c
working on vm
2022-03-25 20:22:41 +01:00
Irmen de Jong
b5331d821c
fix string encoding for escaped characters
2022-03-25 00:17:41 +01:00
Irmen de Jong
27f6d47efa
working on vm codegen
2022-03-24 23:26:57 +01:00
Irmen de Jong
06b38506d1
working on vm translator
2022-03-22 01:43:02 +01:00
Irmen de Jong
fd581ffc37
moved pattern_match() from prog8_lib to string module
2022-03-21 21:32:10 +01:00
Irmen de Jong
7d2bf892b1
added start of virtual machine compilation target
2022-03-19 00:57:35 +01:00
Irmen de Jong
a99e77093f
added syscall() builtin functions (only useful for experimental code gen)
2022-03-17 01:19:58 +01:00
Irmen de Jong
92737bb695
better handling of loadAddress
2022-03-13 16:21:02 +01:00
Irmen de Jong
9b81955544
optimizing new Ast
2022-03-13 11:49:07 +01:00
Irmen de Jong
4a0031080a
getting rid of directives in new Ast
2022-03-13 00:30:20 +01:00
Irmen de Jong
40e9fba312
working on new Ast and XML export to test it
2022-03-12 22:38:16 +01:00
Irmen de Jong
e227cc92ff
new ast: regular subroutine has just 0 or 1 return type
2022-03-12 14:12:06 +01:00
Irmen de Jong
abcdd331db
started with a simulator
2022-03-10 21:23:00 +01:00
Irmen de Jong
0a04e626d7
added new intermediate (simplified) AST meant for new codegen
2022-03-10 21:21:15 +01:00
Irmen de Jong
a03c4c3659
working on symbol table
2022-03-04 22:26:46 +01:00
Irmen de Jong
38beebe720
fix pipe check for number of args
2022-03-02 21:29:09 +01:00
Irmen de Jong
fc1c3c6808
working on altered pipe syntax
2022-03-02 20:58:38 +01:00
Irmen de Jong
96ba895b84
working on altered Pipe syntax
2022-02-27 02:42:28 +01:00
Irmen de Jong
df35dfe3bf
added atari XEX output format with default $2000 load address
2022-02-26 15:36:22 +01:00
Irmen de Jong
c5504c6657
added ATASCII encoding table for atari
2022-02-25 23:48:39 +01:00
Irmen de Jong
530e109433
added altirra as atari emu2
2022-02-25 19:16:37 +01:00
Irmen de Jong
6185d5eca1
Merge remote-tracking branch 'origin/master'
2022-02-24 22:52:08 +01:00
Irmen de Jong
891f870ec0
todo
2022-02-23 21:58:27 +01:00
Freddy
ad9933f0f6
fixed chrout for atari and added two examples
2022-02-23 16:42:22 +01:00
Irmen de Jong
eeb3c968d6
streamline handling of launcher type and program load address. %address is now required if not using a basic-launcher.
2022-02-22 22:43:14 +01:00
Irmen de Jong
406658a10f
reimplemented sys.memcopy and sys.memset on cx16 to work without kernal too
2022-02-22 21:07:19 +01:00
Irmen de Jong
6a0551cea1
added 'atari' compiler target beginnings (Atari 800 XL)
...
also default char and string encoding now taken from compiler target
2022-02-22 00:52:35 +01:00
Irmen de Jong
21e9723bb2
allow the last term in a pipe statement to be a variable, rewrites this as var = <rest of pipe>
2022-02-21 02:33:19 +01:00
Irmen de Jong
60b2c44a44
fix returntype handling of builtinfunctions, fix errors in pipe expressions
2022-02-21 01:44:29 +01:00
Irmen de Jong
c4fe3ecc0a
refactor
2022-02-20 22:04:18 +01:00
Irmen de Jong
7a2164b4d0
introduced BuiltinFunctionCallStatement node for codegen
2022-02-18 23:27:11 +01:00
Irmen de Jong
0a43eae184
rework registerArgsViaStackEvaluation to use cpu hardware stack instead
2022-02-18 22:38:00 +01:00
Irmen de Jong
3117e2b2a3
more tweaks
2022-02-18 01:25:08 +01:00
Irmen de Jong
7aa807ec7f
proper error if attempting to do a containment check against non const range, and some cleanup in asmgen
2022-02-16 00:39:19 +01:00
Irmen de Jong
4d16e1e14a
now checks for invalid text encodings for given compilation target
2022-02-15 01:39:12 +01:00
Irmen de Jong
73fc18099e
properly report duplicate label names
2022-02-15 00:39:10 +01:00
Irmen de Jong
2725c4ad4d
slight tweaks to zp and allocator
2022-02-12 00:15:52 +01:00
Irmen de Jong
c8cd6e9460
removed old @"screencodes" string encoding syntax (use sc:"hello" instead)
2022-02-11 22:07:14 +01:00
Irmen de Jong
0cd27d6129
fix empty lines in subroutine ast printing
2022-02-11 21:44:38 +01:00
Irmen de Jong
c13b7fd883
report free/occupied Zeropage space at end of compilation
2022-02-10 21:59:44 +01:00
Irmen de Jong
41b1c80492
label name from memory() no longer interned as string var
2022-02-10 00:45:20 +01:00
Irmen de Jong
e5d7316e5d
streamlining non-zpvars asmgen using new mechanism
2022-02-10 00:09:09 +01:00
Irmen de Jong
b043c3a6da
streamlining vars asmgen using new mechanism
2022-02-09 21:58:25 +01:00
Irmen de Jong
98b2855b9c
cleanups
2022-02-09 16:35:52 +01:00
Irmen de Jong
f3c52c409f
variable zp allocation now only done in the allocator
2022-02-08 23:44:21 +01:00
Irmen de Jong
8c2e6971fc
start using vars instead of callgraph (2)
2022-02-08 21:09:00 +01:00
Irmen de Jong
1903990f30
start using vars instead of callgraph
2022-02-08 20:40:10 +01:00
Irmen de Jong
7d67005709
more rewrite variable allocation
2022-02-08 20:40:10 +01:00
Irmen de Jong
6bdd81623f
cleaning up AsmGen interface
2022-02-06 17:07:03 +01:00
Irmen de Jong
8ae3bad6f7
fix rts in empty asmsub
2022-02-06 05:05:58 +01:00
Irmen de Jong
77de99b383
rts-check for non-inlined subroutines + var init adjustment when noreinit, moved out of codegen
2022-02-06 04:03:03 +01:00
Irmen de Jong
312949f336
added experimental codegen backend option
2022-02-05 21:42:03 +01:00
Irmen de Jong
30e1c3307c
simplify SourceCode: just read the full text immediately. Also optimized imports.
2022-02-05 03:50:54 +01:00
Irmen de Jong
08e052380a
comments
2022-02-05 03:14:26 +01:00
Irmen de Jong
548374ac2d
fix: do proper sign exension when multiplying signed word and byte vars
2022-02-05 01:52:13 +01:00
Irmen de Jong
69b9dfa468
fix invalid recursion warning for code referencing subroutine but not via a call
2022-02-01 23:09:52 +01:00
Irmen de Jong
5c8c64242f
callgraph: nameInAssemblyCode searches smarter (for unused())
2022-02-01 00:33:05 +01:00
Irmen de Jong
f965804e6d
fix invalid optimization of returning a parameter variable in a subroutine
2022-01-28 16:44:42 +01:00
Irmen de Jong
ec078eba72
optimize w=msb(w) => w>>=8, w=lsb(w) ==> w&=$00ff
2022-01-28 16:11:52 +01:00
Irmen de Jong
7b3cd71085
fixed improper optimization of word<<8 and word>>8
2022-01-28 13:54:06 +01:00
Irmen de Jong
06128b5d07
optimize word&=$ff00 and word&=$00ff
2022-01-28 13:40:28 +01:00
Irmen de Jong
5ecf2a3357
enable more optimizations for typecasted assignments. Fixed missing codegen for assigning bytes to words in certain cases.
2022-01-27 18:05:25 +01:00
Irmen de Jong
e2b8c069d7
check for missing '&' in string + value expressions (can't just add a value to a string)
2022-01-24 23:30:40 +01:00
Irmen de Jong
08db72903c
for long containment checks use a subroutine instead of huge cmp-table
2022-01-24 22:40:22 +01:00
Irmen de Jong
46f9fab140
library API change: string.find now returns index of character + carry bit status (instead of substring address)
2022-01-24 21:37:04 +01:00
Irmen de Jong
b7d06f2c0a
API change: added alignment parameter to memory() function
2022-01-24 18:58:57 +01:00
Irmen de Jong
586ce1fc80
tweak return's use of intermediate variable
2022-01-24 01:10:04 +01:00
Irmen de Jong
adb979df38
tweak comment
2022-01-23 22:34:05 +01:00
Irmen de Jong
3401cb5b4a
fixed compiler recursion crash when returning certain typecasted value
2022-01-23 19:13:20 +01:00
Irmen de Jong
5766208207
fix compiler crash when initializing an array var with another array var
2022-01-23 14:23:34 +01:00
Irmen de Jong
4bf4771f08
fix @requirezp in astToSource. Fix sometimes allocating zeropage variables in normal ram.
2022-01-23 13:42:52 +01:00
Irmen de Jong
0e87db9eb7
fix invalid size copied when initializing arrays in Zeropage
2022-01-23 13:00:01 +01:00
Irmen de Jong
1e053783f3
fix invalid size copied when assigning non-byte arrays
2022-01-23 02:42:36 +01:00
Irmen de Jong
7afc96112b
now correctly requires using & (address-of) when assigning the address of a label or subroutine, used to generate invalid code when it was omitted
2022-01-23 02:23:30 +01:00
Irmen de Jong
7bb41a30ed
fixed compiler crash when assigning number larger than 65535
2022-01-23 01:44:16 +01:00
Irmen de Jong
3d1b0eb843
fixed compiler crash when using cx16.r0H as function call argument
2022-01-23 01:28:16 +01:00
Irmen de Jong
9219ec539d
allow "goto pointervar" for indirect jumps
2022-01-21 22:55:59 +01:00
Irmen de Jong
c8bd57cd4d
fixed signature of mouse_get(): it returns the buttonstatus in A. Added convenience cx16.mouse_pos() routine.
2022-01-21 22:06:17 +01:00
Irmen de Jong
9ed7587e3e
document new string encoding syntax
2022-01-19 21:21:33 +01:00
Irmen de Jong
3b59592110
generalize string encoding flag into enum
2022-01-18 21:21:49 +01:00