Commit Graph

4103 Commits

Author SHA1 Message Date
Bob Andrews
801508aecf Merge pull request #2735 from kugelfuhr/kugelfuhr/fix-2025
Add an optimization that removes compare instructions preceeding RTS or function calls
2025-06-26 00:29:29 +02:00
Kugel Fuhr
55d9b2dbd0 Rewrite the optimization step from c0a1b1b887 to
remove compares not only before RTS but also befoire function calls that don't
use the flags but destroy all of them. The latter is currently the case for
all functions called. This way the optimization covers a lot more cases than
just checking for RTS.
2025-06-25 20:07:36 +02:00
Kugel Fuhr
7a6c60ade4 Do also sort variables to satisfy sorted_codeopt.sh. 2025-06-24 20:21:43 +02:00
Kugel Fuhr
c0a1b1b887 Add an optimization step that removes compare instructions preceeding an RTS.
Since nothing is passed back in the flags, these instructions have no effect.
Fixes #2025.
2025-06-24 18:02:24 +02:00
Bob Andrews
54a2410b5a Merge pull request #2674 from GorillaSapiens/c_sp
rename "sp" to "c_sp", avoid conflict with 4510 opcodes
2025-06-24 17:44:13 +02:00
Gorilla Sapiens
b2e5d3cd25 insipid formatting whack-a-mole 2025-06-23 17:51:44 +00:00
Kugel Fuhr
4c81eacefe Added -d/--debug and -m/--multi-pass switches to the disassembler. The latter
will make the disassembler run multiple preparation passes to find all
addresses where labels must be placed. Without -m some label addresses are
found in the final pass, where the disassembler cannot make use of them.
2025-06-23 14:50:40 +02:00
Bob Andrews
c520455b2b Merge pull request #2729 from kugelfuhr/kugelfuhr/fix-2208
When studying a symbol expression use its address size if its smaller than that of the symbol
2025-06-23 14:22:22 +02:00
Bob Andrews
c20461d213 Merge pull request #2722 from kugelfuhr/kugelfuhr/da65-cleanup
Small cleanup for da65
2025-06-23 14:18:18 +02:00
Bob Andrews
c832af8a71 Merge pull request #2710 from kugelfuhr/kugelfuhr/fix-2694
Fix wrong file offset handling for a memory area with only run segments written to a file
2025-06-23 14:17:55 +02:00
Kugel Fuhr
96bb1e4336 Fix coding style. 2025-06-23 14:02:56 +02:00
Kugel Fuhr
49713f73e0 Output relative branch targets as "*-30" instead of "* + (-30)". 2025-06-23 14:01:29 +02:00
Bob Andrews
540a6a7658 Merge pull request #2728 from kugelfuhr/kugelfuhr/da65-improvements
Cleanup for the da65 code base
2025-06-23 13:47:23 +02:00
mrdudz
034fc93c75 enable 4510/45GS02 in the compiler - however, the resulting asm files cant be assembled because of sp vs c_sp clash 2025-06-23 13:23:23 +02:00
mrdudz
8615c244d9 add initial target for mega65, also added c65 where missing. reworked from #1792 2025-06-22 21:07:38 +02:00
Gorilla Sapiens
a7af49a763 Merge branch 'master' into c_sp 2025-06-22 19:02:24 +00:00
Kugel Fuhr
7d231d60a6 Minor corrections after looking at the diff. 2025-06-22 20:36:26 +02:00
Kugel Fuhr
b9a703749c Replace all tables by hash tables. This allows to remove the ugly special
casing of "long addresses" and prepares the code base for use with the full
address range of the 65816.
Use fixed size data types for addresses and target data words of known size.
Many other minor improvements.
2025-06-22 20:36:26 +02:00
Kugel Fuhr
7854a53434 When studying expressions and recalculating the address size for a symbol
expression, use the symbol address size only if it is smaller than the one
that was calculated.
2025-06-22 16:12:07 +02:00
mrdudz
233c784c03 fix aslq in the disassembler 2025-06-22 01:16:03 +02:00
mrdudz
2ae30b5b50 cleanup 2025-06-22 01:15:40 +02:00
mrdudz
c3b75f0ac1 comment 2025-06-22 01:15:10 +02:00
mrdudz
4a11fa791a more codestyle 2025-06-21 22:33:43 +02:00
mrdudz
6b554362a5 codestyle/comment 2025-06-21 22:23:19 +02:00
mrdudz
12e40f4aff fix some codestyle 2025-06-21 22:05:30 +02:00
mrdudz
c35405f14b add new sourcefile(s) 2025-06-21 20:52:03 +02:00
mrdudz
5e414edb50 are we more pedantic than local make? 2025-06-21 20:47:57 +02:00
mrdudz
2244a5ab0a include header :) 2025-06-21 20:44:37 +02:00
mrdudz
3321910848 implement 45GS02 compound instrictions in the disassembler 2025-06-21 20:37:31 +02:00
mrdudz
37144ed014 fix akkumulator addressing for some compound instructions 2025-06-21 20:35:25 +02:00
mrdudz
9344d87b05 part of #1792 - 48GS02 assembler support 2025-06-21 00:56:34 +02:00
Bob Andrews
d333627081 Merge pull request #2707 from mrdudz/m740
m740 Support
2025-06-20 19:39:32 +02:00
Bob Andrews
64c936317d Merge pull request #2720 from GorillaSapiens/issue_2714
fixes #2714
2025-06-20 18:00:50 +02:00
Bob Andrews
fa4d704ee8 Update main.c - codestyle 2025-06-20 17:53:52 +02:00
Gorilla Sapiens
de844d48c4 fixes #2714 2025-06-19 22:36:16 +00:00
Bob Andrews
b630dac728 Merge pull request #2718 from kugelfuhr/kugelfuhr/fix-505
Fix the behavior of variable symbols in regard to cheap locals
2025-06-19 23:44:38 +02:00
Bob Andrews
3989ce1185 Merge pull request #2715 from kugelfuhr/kugelfuhr/fix-2527
Added a few simple optimizations
2025-06-19 23:39:04 +02:00
mrdudz
02e79d35d7 no need to fix the assembler, but making da65 produce the same mnemonics ans ca65 uses seems like a good idea :) 2025-06-19 21:44:14 +02:00
Bob Andrews
1f23fc6ba8 Merge pull request #2716 from kugelfuhr/kugelfuhr/fix-2649
Fix an internal error in da65 when there are certain labels in a skipped section
2025-06-19 19:33:17 +02:00
Kugel Fuhr
54f63a0cdc Fix the behavior of variable symbols in regard to cheap locals. Previously
every assignment to a variable symbol opened the same scope for cheap locals.
So when redefining a variable symbol, an old cheap local scope was reopened
which was unexpected and confusing. The change fixes this so that only the
first definition of a variable symbol opens a new scope for cheap locals, but
redefinitions of the same symbol do not.
2025-06-19 09:11:30 +02:00
Kugel Fuhr
8d407c7b17 Fix #2649. When generating labels for "skip" sections, GetGranularity() is
called which wouldn't handle this type.
2025-06-18 21:54:19 +02:00
Kugel Fuhr
2ceaa3fabb Added a few simple optimizations that resolve most of #2527. 2025-06-18 10:34:13 +02:00
Gorilla Sapiens
8cb0578447 changes suggested by mrdudz 2025-06-18 06:38:38 +00:00
Gorilla Sapiens
06a77abc68 Merge branch 'master' into sane_makefile_output 2025-06-18 06:26:58 +00:00
Gorilla Sapiens
5a4b11e7ff Merge branch 'master' into c_sp 2025-06-18 06:14:39 +00:00
mrdudz
00de49a46d codestyle 2025-06-18 02:43:40 +02:00
mrdudz
05506ede2a comments 2025-06-18 02:41:22 +02:00
mrdudz
157ddf2c5b codestyle 2025-06-18 02:41:15 +02:00
mrdudz
499fcbdb5f we dont use the table in the custom jsr 2025-06-18 02:38:34 +02:00
mrdudz
80b4ea304b fix table for added address modes 2025-06-18 02:24:59 +02:00