Irmen de Jong
a2133f61a8
get rid of all the require() checks that test result regs to be different
2023-03-14 01:01:46 +01:00
Irmen de Jong
199adbbcf0
IR: don't allow to have 2 same registers on instructions
2023-03-14 00:45:41 +01:00
Irmen de Jong
025183602f
refactor IR returnregs 6
2023-03-13 21:35:23 +01:00
Irmen de Jong
451e527b7c
refactor IR returnregs 4
2023-03-13 03:54:16 +01:00
Irmen de Jong
54dd3a00df
refactor IR returnregs 3
2023-03-13 03:20:06 +01:00
Irmen de Jong
03c5dab79d
refactor IR returnregs 2
2023-03-13 02:50:41 +01:00
Irmen de Jong
78a097585d
new IR call and return instructions to deal with returnregisters
2023-03-12 21:54:59 +01:00
Irmen de Jong
39132327cc
added optimizer for IR code
...
with two very simple optimizations
2023-03-12 20:30:51 +01:00
Irmen de Jong
592f74124c
fix startup subroutine linking in VM
2023-03-12 16:09:55 +01:00
Irmen de Jong
d76547ead4
don't crash on certain undefined symbols, give proper error instead
...
Also the error handlers in unit tests now de-duplicate messages just like the compiler itself does
2023-03-11 14:58:41 +01:00
Irmen de Jong
043df18daa
set X to bottom part of eval stack in irq handler. fixes #94
2023-03-10 23:29:34 +01:00
Irmen de Jong
96996bf18e
be less aggressive with translating adds/subs into auto inc/decrements, to avoid code bloat
2023-03-10 23:01: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
9a36e8ba3b
todo
2023-03-09 00:00:03 +01:00
Irmen de Jong
c968bacb01
fix pokew() crash with certain address expressions
2023-03-08 23:29:57 +01:00
Irmen de Jong
25199dfb43
change tokenizer so that A,X,Y now are parsed correctly as identifiers as well
2023-03-08 22:57:19 +01:00
Irmen de Jong
fc253237c9
fix issues with reporting inlined subroutines as unused
2023-03-07 23:47:14 +01:00
Irmen de Jong
589948c7f4
fix IR translateIfElseNonZeroComparison for ints + floats
2023-03-07 23:07:51 +01:00
Irmen de Jong
fd07ae5225
fix various IR file and symboltable issues
2023-03-07 19:40:11 +01:00
Irmen de Jong
1436480eab
added a few more comparison expression optimizations
2023-03-04 16:01:40 +01:00
Irmen de Jong
448d176c24
fix vm crash on empty string
2023-03-04 15:35:54 +01:00
Irmen de Jong
fd269453a4
todos
2023-03-04 14:14:01 +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
540b3ae2f4
tweak BinaryExpression splitting
2023-02-28 21:45:38 +01:00
Irmen de Jong
dbfe4140e1
improved import search paths
2023-02-28 20:08:11 +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
ba9268a09e
added -varshigh
compiler option to move BSS section.
...
Documented BSS a bit in the manual.
2023-02-22 22:44:29 +01:00
Irmen de Jong
5318ba6c6e
shrink evalstack from 2 to 1 page
...
c64=$cf00-$cfff, x16: $0700-$07ff
2023-02-21 22:52:04 +01:00
Irmen de Jong
fd5ebef488
cx16 startup code now also selects ram bank 1
2023-02-21 21:53:32 +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
0ea70ba656
fix proper initialization of zeropagevars with 'noreinit'
2023-02-20 23:05:27 +01:00
Irmen de Jong
c3c82282ba
reinitGlobals option is clearer than the inverse
2023-02-19 19:09:29 +01:00
Irmen de Jong
adc15c24ef
introduce bss segments
2023-02-19 18:12:37 +01:00
Irmen de Jong
dddf9a9396
remove explicit 'bss' from St var, changed to 'uninitialized'
2023-02-19 16:50:06 +01:00
Irmen de Jong
9ca6860ffa
tweak
2023-02-19 15:08:16 +01:00
Irmen de Jong
6012839f0e
todo
2023-02-16 23:06:09 +01:00
Irmen de Jong
8e9cbab053
todo
2023-02-16 22:53:16 +01:00
Irmen de Jong
c59df6ec20
optimize isZpVar
2023-02-16 00:41:20 +01:00
Irmen de Jong
5e8f767642
6502 codegen on new Pt-AST.
2023-01-22 17:10:52 +01:00
Irmen de Jong
bbf6357222
remove workaround for black cursor at boot as this was recently fixed in the kernal rom.
2023-01-17 23:27:27 +01:00
Irmen de Jong
dc16629c24
todo
2023-01-04 23:57:59 +01:00
Irmen de Jong
3718b9d768
less joins
2023-01-02 02:10:38 +01:00
Irmen de Jong
c25eb088ec
redo 8e730ef93d
to avoid larger code generated
2023-01-01 23:43:33 +01:00
Irmen de Jong
8e730ef93d
optimizing scoped names more and fix scoping of identifier names in arrays (pointers) in SymbolTable
2022-12-31 03:20:20 +01:00
Irmen de Jong
e0913a39ab
optimizing
2022-12-30 18:50:45 +01:00
Irmen de Jong
ee0dbdad35
don't reshuffle 'start' routine to the top. Fixes zsound examples.
2022-12-30 17:12:01 +01:00
Irmen de Jong
9225f88f89
diskio comments
2022-12-30 15:49:53 +01:00
Irmen de Jong
002006517a
rewrite bool=bool^1 into bool=not bool
2022-12-29 19:42:38 +01:00
Irmen de Jong
f5b202d438
fix ast type error in float cast to bool
2022-12-28 22:18:21 +01:00
Irmen de Jong
a7df094ff4
don't allow ~ on booleans, also introduce SZ and SNZ instructions in IR to complete the conditional-set instruction list.
2022-12-28 21:19:38 +01:00
Irmen de Jong
1e6fa77633
ir: 4 new instructions to branch on signed <0, >0, <=0, >=0
2022-12-28 13:14:20 +01:00
Irmen de Jong
eb4cff202c
removed redundant branch opcodes in IR: BLT(S), BLE(S). Just use swapped BGT(S), BGE(S).
2022-12-28 12:41:05 +01:00
Irmen de Jong
7ee777f405
vm/ir: for loop is now correctly skipped if loopvar>endvar
...
this is different still in the 6502 codegen, where it wraps around $00!
2022-12-27 18:12:41 +01:00
Irmen de Jong
1860f66de5
allow "x not in array" as equivalent to "not x in array"
...
update antlr parsing lib
2022-12-23 17:59:56 +01:00
Irmen de Jong
ded9ada9bc
allow "not xx in array" expression in 6502 codegen
...
fix compiler crash on certain bool to byte casts
2022-12-23 17:07:34 +01:00
Irmen de Jong
d0e6a2eb8b
fix compiler crash on hoisting certain vardecls from inner scopes
2022-12-22 18:49:53 +01:00
Irmen de Jong
4e103a1963
making snow example more interesting
2022-12-22 13:04:26 +01:00
Irmen de Jong
475e927178
version 8.8
2022-12-17 23:00:49 +01:00
Irmen de Jong
def7e87151
fixed silly if-goto expression code in IR codegen where it used too many branching instructions
2022-12-12 22:47:15 +01:00
Irmen de Jong
27568c2bef
fixed silly code generated by some NOT-expressions (unused temporary)
2022-12-12 21:57:22 +01:00
Irmen de Jong
0694a187d7
unsigned>0 now optimized into unsigned!=0
2022-12-12 20:37:57 +01:00
Irmen de Jong
ca1089b881
optimized codegen for logical expressions with simple right operand (such as c64.READST() & $40 )
2022-12-06 20:23:56 +01:00
Irmen de Jong
a1d04f2aad
added more $03xx vector definitions to C64/C128/CX16 syslib
2022-12-06 20:23:56 +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
f2273c0acc
fix several FP rom routine addresses on cx16.
2022-12-03 19:56:54 +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
5e896cf582
preparing to add Golden RAM
2022-12-03 00:21:31 +01:00
Irmen de Jong
add3491c57
fix possible vardecl issue for prefixed params
2022-11-30 22:56:54 +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
483f313eda
ir: keep correct child node order in blocks
2022-11-24 01:19:48 +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
d4a35ba6ff
got rid of diskio.have_first_byte overhead
2022-11-23 21:53:36 +01:00
Irmen de Jong
e2f20ebf94
fix crash on empty conditional branch statement (if_cc { } )
2022-11-23 02:14:48 +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
77e956a29f
API change: diskio.list_files doesn't have an internal buffer anymore, you now have to supply a buffer + size yourself. Renamed to list_filenames
2022-11-20 23:27:22 +01:00
Irmen de Jong
08275c406a
added chdir/mkdir/rmdir/relabel to cx16diskio
2022-11-20 22:59:44 +01:00
Irmen de Jong
2931e1b87b
diskio file lister routines now also put file type (prg, seq, dir) in new diskio.list_filetype variable
2022-11-20 20:22:09 +01:00
Irmen de Jong
0f6a6d6fea
attempt to make gfx2 screen mode 0 cleanup more robust on real hardware
2022-11-18 22:53:28 +01:00
Irmen de Jong
91fdb3e2d4
ir: store labels in blocks, but still useless
2022-11-17 00:37:45 +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
df1793efbf
fixed: word << 12 is suddenly an uword (with optimizer on)
2022-11-15 03:00:41 +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
8f3aaf77a1
fix optimizer hanging on uword xx :: xx >>= 8 / xx=msb(xx)
2022-11-15 01:40:13 +01:00
Irmen de Jong
00c059e5b1
adding cx16/adpcm example
2022-11-15 01:17:28 +01:00
Irmen de Jong
b465fc5aaf
fix bug in word array containment check (prog8_lib.containment_wordarray) that could hang the loop
2022-11-12 23:19:01 +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
d08451bccc
ir: Block can now contain inline binary
2022-11-12 20:17:23 +01:00
Irmen de Jong
267b6f49b5
IRFileReader parses the p8ir file with xml parser
2022-11-12 16:51:20 +01:00
Irmen de Jong
e6688f4b9d
clearer error for VM limitation cannot load label address as value
2022-11-12 13:45:02 +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
fc55b34d84
ir: fix asmsub multi-value return codegen
2022-11-03 22:29:41 +01:00
Irmen de Jong
6f67fc0e02
ir: get rid of '_' symbol prefix
2022-11-03 21:54:53 +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
06b032af91
refactor
2022-11-03 00:20:31 +01:00
Irmen de Jong
e094785cbd
ir: fix unused code remover
2022-11-02 23:16:51 +01:00
Irmen de Jong
e7408224ac
ir: remove position tracking from codechunk for now
2022-11-02 22:12:42 +01:00
Irmen de Jong
e67c05c274
ir: fix asmsub contents not appearing in IR file
2022-11-02 20:50:51 +01:00
Irmen de Jong
890f55f91a
fixup compiler internals diagram
2022-10-31 00:39:43 +01:00
Irmen de Jong
5efe2b027a
ir: fix chunk linkage in optimizer
2022-10-30 23:42:41 +01:00
Irmen de Jong
5b6569d0f9
ir: fix overwriting chunk label
2022-10-30 19:03:02 +01:00
Irmen de Jong
67a36d8d31
more robust 'return' statement checks in subroutines
2022-10-30 14:41:28 +01:00
Irmen de Jong
7cc3cc3990
ir: fix non-code chunk linkage
2022-10-30 12:55:06 +01:00
Irmen de Jong
b718b12083
ir/vm fix chunk linkage
2022-10-26 00:12:56 +02:00
Irmen de Jong
cfa7258ff4
various
2022-10-25 23:18:42 +02:00
Irmen de Jong
585009ac5c
ir: fix syscall numbers and more
2022-10-24 01:57:37 +02:00
Irmen de Jong
30ee65fd14
ir: ensure that block and sub labels are also on the first chunk in said block/sub
2022-10-23 18:54:08 +02:00
Irmen de Jong
fabae6e970
ir: fix handling of labeled chunks
2022-10-16 23:53:17 +02:00
Irmen de Jong
a9f9c40d8a
ir: fix handling of labeled chunks
2022-10-13 00:56:44 +02:00
Irmen de Jong
6fc89607d3
ir: moving to labeled chunks, no more IRLabel nodes
2022-10-07 00:34:56 +02:00
Irmen de Jong
2340760f53
rename
2022-10-04 22:54:14 +02:00
Irmen de Jong
e7682119e0
ir: count register uses
2022-10-02 15:56:06 +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
94f0f3e966
ir: join code chunks
2022-09-30 02:47:33 +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
7ea7e63f44
use require() more often
2022-09-27 18:27:55 +02:00
Irmen de Jong
1d2ce2cbeb
consolidate IR line parse function
2022-09-27 18:02:57 +02:00
Irmen de Jong
06cf2e0bd7
vm: fix memory slabs (bsieve example)
2022-09-27 16:32:44 +02:00
Irmen de Jong
9d219ae4b9
refactor
2022-09-27 03:32:39 +02:00
Irmen de Jong
71f5a6c50e
remove p8virt from compiler diagram
2022-09-27 02:52:29 +02:00
Irmen de Jong
90b2be2bf4
vm: new memory initialization of array vars
2022-09-27 02:43:50 +02:00
Irmen de Jong
db1aa8fcbd
vm: new translation of IRProgram into vm program list
2022-09-27 01:50:00 +02:00
Irmen de Jong
11c000f764
moved codeGenVirtual module into virtualmachine module
2022-09-26 20:00:40 +02:00
Irmen de Jong
4d6dcbd173
ir: consolidate IRCodeInstruction and Instruction
2022-09-26 19:46:44 +02:00
Irmen de Jong
0da117efd2
vm: get rid of .p8virt file and cruft
2022-09-26 19:28:40 +02:00
Irmen de Jong
533c368e32
make IRFileReader's file source more general
2022-09-26 14:47:28 +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
1d65d63bd9
ir: making sure all names are scoped properly. textelite now runs in vm
2022-09-25 18:02:35 +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
ca41669f4f
vm: fix scoped name in address-of inside array
2022-09-24 18:26:35 +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
4f8fb32136
some docs about compiler internal architecture
2022-09-21 17:34:52 +02:00
Irmen de Jong
e0fbce0087
few more unittests for IR
2022-09-21 02:59:36 +02:00
Irmen de Jong
fb22f78fb3
added '-keepIR' option to save the IR file if it's generated.
2022-09-20 12:30:22 +02:00
Irmen de Jong
5167fdb3f0
docs
2022-09-20 04:10:49 +02:00
Irmen de Jong
b4352ad38b
refactor IR codegen into separate module
2022-09-19 19:24:24 +02:00
Irmen de Jong
d07d00fa41
Join codeAst and codeCore modules
2022-09-19 17:28:18 +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
c8f3bfa726
vm assembler now understands simple indexed addresses (symbol+number)
2022-09-18 02:17:42 +02:00
Irmen de Jong
3091e3a1c8
IR support for instructions operating on cpu regs
2022-09-18 01:51:04 +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
7294ec9a3c
working on address-of
2022-09-15 22:44:33 +02:00
Irmen de Jong
e34bab9585
change syntax of address-of in p8virt code to &X, instead of {X}
2022-09-13 23:28:52 +02:00
Irmen de Jong
6886b61186
also output inline asm chunks
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
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
bb5ffb24a8
add IDEA antlr parser build info to documentation
2022-08-21 13:32:31 +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
f37a822725
move
2022-08-14 13:17:03 +02:00
Irmen de Jong
f249ccd414
added asm optimization for same pointer index
2022-08-14 12:50:46 +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
ac1bd2fb7b
virtual: properly output "memmapped" variables too
...
still as regular variables though
2022-08-08 20:42:17 +02:00
Irmen de Jong
e560e2ab3f
vm instructions now contain info on input/output registers
2022-08-07 18:49:16 +02:00
Irmen de Jong
1e441c2ddf
tweak vm codegen
2022-08-07 13:45:03 +02:00
Irmen de Jong
93ce74eeb1
removed problematic expression "simplifications" (that introduced arbitrary r9 temp register usage)
2022-08-07 12:26:11 +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
4644c9b621
got rid of GoSub ast node and codegen complexity related to that.
...
sometimes programs get smaller, sometimes bigger.
2022-08-07 03:24:20 +02:00
Irmen de Jong
34aa917ca4
allow bool return type (and arguments) for asmsub / romsub
2022-08-02 23:07:42 +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
f2d27403c5
add string.endswith() to efficiently test for a suffix without copying
...
add string.startswith() to efficiently test for string prefix without copying
2022-07-21 00:38:30 +02:00
Irmen de Jong
aeabf0f324
nicer colors
2022-07-17 21:37:15 +02:00
Irmen de Jong
80ab552ad8
fix wrong code for signed word >= 0
2022-07-17 19:02:56 +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
5189eaca36
move the vm unit tests to codeGenVirtual module and remove virtualmachine dependency in the compiler module
2022-07-17 12:56:22 +02:00
Irmen de Jong
cfb31377fc
c64 zeropage: added a few more locations to Kernalsafe free list that should be safe
...
this makes $02-$21 inclusive, available for use later (x16 virtual registers are placed here on x16...)
2022-07-17 12:12:47 +02:00
Irmen de Jong
a07c52e112
conv.any2uword / conf.hex2uword can now deal with iso lower and upper case letters as well.
2022-07-17 02:39:40 +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
350dc731f1
cx16: sys.reset_system() now resets vera fully as well (such as PSG sound), kernal didn't seem to do that
2022-07-14 23:44:53 +02:00
Irmen de Jong
4bc65e9ef7
fix stack crash in cx16.push_vera_context()
2022-07-14 16:33:09 +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
f46e131f18
todo
2022-07-12 19:41:51 +02:00
Irmen de Jong
feb5c8be95
vm: some more peephole optimizations
2022-07-12 19:04:19 +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
840331347b
added a few more vm optimizations and unit tests
2022-07-12 12:42:37 +02:00
Irmen de Jong
6181b12ab8
added -esa option to override the evalstack location, and shift cx16.r0-r15 accordingly
2022-07-11 19:29:04 +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
92eb3b0bf6
bool logical testcase
2022-07-09 22:29:38 +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
9633c0b07a
added bool to syntax files
2022-07-07 23:30:41 +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
65daf29acd
fix compiler crash related to word types in certain comparison expressions
2022-07-07 22:23:56 +02:00
Irmen de Jong
298b25cf7d
fix compiler crash on certain typecasting assignment
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
beea6bc794
about bool
2022-07-04 20:26:03 +02:00
Irmen de Jong
fee58e98c5
tiny optimization
2022-07-03 13:05:30 +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
4b336b1853
if passing a subroutine or label name as an uword argument, without &, add the addressof automatically
2022-07-02 23:55:32 +02:00
Irmen de Jong
e1c77ce236
fix pop() name scoping
2022-07-02 23:27:08 +02:00
Irmen de Jong
064d412ec8
added cx16.push_vera_context() and cx16.pop_vera_context() for use in irq handlers
2022-07-02 23:13:00 +02:00
Irmen de Jong
7fff4f249d
optimize msb(cx16.r0) -> cx16.r0H, lsb(cx16.r0) -> cx16.r0L
2022-07-02 21:38:22 +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
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