Kugel Fuhr
1924e4cc63
Added a test for #2859 .
2025-11-18 14:38:10 +01:00
Kugel Fuhr
c4cd575331
Fix parsing boolean not (.not/!).
2025-11-18 14:35:29 +01:00
Kugel Fuhr
aa73c03f6a
Corrected a typo in the description of .set. Fixes #2854 .
2025-11-09 17:25:57 +01:00
Kugel Fuhr
b4dc41c653
CPU constants must always be defined, not only if a target system was given.
2025-11-01 15:37:57 +01:00
Kugel Fuhr
0dc484f5a7
Fix hardcoded upper limit of input files.
2025-09-08 20:51:27 +02:00
Kugel Fuhr
228671b7c4
Added another test.
2025-07-26 10:17:32 +02:00
Kugel Fuhr
8f4a4040d6
Complete unreachable checking for switch statements.
2025-07-26 09:03:27 +02:00
Kugel Fuhr
70c1bd5e3c
Improved flow analysis in general and especially for "for" loops. Added more
...
tests.
2025-07-26 09:03:04 +02:00
Kugel Fuhr
8ac25376a0
Fix the "double semicolon" problem where a double semicolon after a statement
...
that makes the following code unreachable led to an "unreachable code" warning.
2025-07-26 09:02:54 +02:00
Kugel Fuhr
61f3e43fb6
Rewrote an outdated comment.
2025-07-17 20:52:33 +02:00
Kugel Fuhr
6d45a94127
Do not output a warning about a missing "return" in a function if the function
...
exit is unreachable.
2025-07-17 17:07:34 +02:00
Kugel Fuhr
ed54e9b168
Added several flow control tests.
2025-07-17 16:00:59 +02:00
Kugel Fuhr
f13284d3f8
Move the warning about unreachable code out of the Test() function and into
...
the callers. This has the effect that the location for the warning is much
more precise than before.
2025-07-17 15:43:15 +02:00
Kugel Fuhr
93b94d314a
Implement a simple flow analysis. Tracks control flow of all statements with
...
the exception of "switch". Outputs warnings for unreachable code. Tracks also
"return" but doesn't currently make use of this information.
2025-07-17 15:39:45 +02:00
Kugel Fuhr
1c167b1ff1
Use cl65 to generate the object file from the grc file to avoid having an
...
intermediate .s file lying around that "make check" complains about.
2025-07-16 21:24:25 +02:00
Kugel Fuhr
e82656d8ca
Remove .s files generated from .grc files.
2025-07-16 12:31:18 +02:00
Kugel Fuhr
9ac02f3282
Move constructors into the ONCE segment to fix linker warnings.
2025-07-14 19:52:07 +02:00
Kugel Fuhr
f86f602b9e
Add a description for --memory-model to the docs.
2025-07-14 16:45:42 +02:00
Kugel Fuhr
4120f35276
Added tests for warnings or errors that now have notifications.
2025-07-14 12:59:52 +02:00
Kugel Fuhr
170ddc6e33
Add a --warnings-as-errors option to cc65 for compatibility reasons.
2025-07-14 11:35:53 +02:00
Kugel Fuhr
d54844c76b
Make the EXTZP segment optional for Atari 7800.
2025-07-14 07:03:53 +02:00
Kugel Fuhr
3dfde7baef
For the cpudetect tests, check the binary results for all instructions, not
...
just for a few selected ones.
2025-07-13 21:43:34 +02:00
Kugel Fuhr
c7096ab6d7
Fix an error that was introduced by me in a4a24280f2:
...
Using a pipe causes a subshell to be generated so the "exit" statements will
just leave the subshell. As a consequence, the sortedxxx.sh scripts produced
output but no error exit code. Which in turn caused an error in #2778 to slip
through undetected.
2025-07-13 17:56:31 +02:00
Kugel Fuhr
2e4c18770b
Add a --warnings-as-errors to cl65.
2025-07-13 16:34:36 +02:00
Kugel Fuhr
c2f17b6f6b
When initialized data is found in a segment, print the first module where this
...
data comes from to ease debugging.
2025-07-13 16:34:29 +02:00
Kugel Fuhr
2e3edf9b1b
Some reformatting and improved diagnostics.
2025-07-13 16:34:20 +02:00
Kugel Fuhr
3e81cd6ae0
Renames CfgError -> PError, CfgWarning -> PWarning.
2025-07-13 16:33:59 +02:00
Kugel Fuhr
7d963d4490
Change the output format for .assert. Use --no-utf8 for the tests.
2025-07-13 16:33:15 +02:00
Kugel Fuhr
074a3f513e
Add the --color and --no-utf8 options to cl65 which will pass it to the tools
...
that understand it.
2025-07-13 16:33:03 +02:00
Kugel Fuhr
79967ff01b
Support colors in diagnostic output.
2025-07-13 16:32:56 +02:00
Kugel Fuhr
96f8ce4cee
Move the functions to output config file errors from scanner.c to error.c.
2025-07-13 16:32:47 +02:00
Kugel Fuhr
6f45af3c9e
Use console properties. Add the --no-utf8 and --color options.
2025-07-13 16:32:37 +02:00
Kugel Fuhr
da0e3907ec
Move the code to parse color strings into the CP_Parse() function and use it.
2025-07-13 16:32:23 +02:00
Kugel Fuhr
2926a95e71
Use correct type for function used in atexit().
2025-07-10 17:14:50 +02:00
Kugel Fuhr
72e3956aeb
Add missing definitions for Windows.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
26968ffdf2
Fixed a typo :-(
2025-07-10 17:14:50 +02:00
Kugel Fuhr
bb255838a6
Fix include files for Windows (hopefully).
2025-07-10 17:14:50 +02:00
Kugel Fuhr
0c14830da0
Remove tabs.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
abb0adf546
Update visual studio project files with added sources.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
97ef430053
Restore description for --debug which was lost.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
7e97e99bae
Do also color quoted text.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
8c654193f7
For the assembler tests, switch off UTF-8 output so we have always the
...
identical diagnostics indepdendent of the console properties.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
8d7c87f753
Fix problem with UTF-8 output when switching the code page under windows fails.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
c466faf484
Use UTF-8 for diagnostic output if it is available. Added a command line
...
switch --no-utf8 to disable the use of UTF-8 characters.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
b1eb1bf6ab
Colorize diagnostics.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
ffcff0fa61
Much improved error messages for ca65. For most errors it will now say what
...
was expected and what was found instead. Also improved error recovery in a few
places.
2025-07-10 17:14:47 +02:00
Kugel Fuhr
d82a1f9fa0
Apply changes by @mrduz. Fixes an error in the makefile and adjusts the
...
mostlyclean target accordingly.
2025-07-09 13:35:27 +02:00
Kugel Fuhr
735edaa8f7
Add missing files to "clean" target.
2025-07-08 07:38:59 +02:00
Kugel Fuhr
b64c811a3f
Add info about cheap local names in macro local symbols.
2025-07-07 12:05:46 +02:00
Kugel Fuhr
9be9003e9a
Removed the inline.h module and removed the use of macros instead of "static
...
inline".
2025-07-07 11:23:12 +02:00
Kugel Fuhr
8dc815f53f
Fixed typos in comments.
2025-07-06 21:07:34 +02:00
Kugel Fuhr
b7e592699d
Fix a copy&paste error (mrduz).
2025-07-06 20:20:32 +02:00
Kugel Fuhr
57283733e7
Remove unwanted duplicate reference output for the tests.
2025-07-06 20:06:48 +02:00
Kugel Fuhr
929fc94466
Added the necessary control files and reference output for the tests.
2025-07-06 16:58:58 +02:00
Kugel Fuhr
4a8498cb0a
When skipping a macro definintion because of an error, apply the same handling
...
regarding .endmacro as when the macro is parsed regularily: A .endmacro ends
the macro only if is the first token on a line.
2025-07-06 12:45:16 +02:00
Kugel Fuhr
7b79fd1ec1
Added more tests.
2025-07-06 10:42:15 +02:00
Kugel Fuhr
23086bccff
Much improved diagnostics for macros.
2025-07-06 10:41:12 +02:00
Kugel Fuhr
7cd137afb4
Improved diagnostics.
2025-07-06 10:40:25 +02:00
Kugel Fuhr
45a326750c
Added a function to output notifications.
2025-07-06 10:39:29 +02:00
Kugel Fuhr
bcd29de443
Much improved error messages for ca65. For most errors it will now say what
...
was expected and what was found instead. Also improved error recovery in a few
places.
2025-07-06 08:40:05 +02:00
Kugel Fuhr
500b86f1e2
Improve error recovery.
2025-07-04 14:56:20 +02:00
Kugel Fuhr
2e6f04034b
Improved an error message.
2025-07-04 14:51:56 +02:00
Kugel Fuhr
947eecb65c
Add comments to the cputs() and cputc() sources about the former relying on
...
the latter not to clobber ptr1.
2025-07-04 11:20:35 +02:00
Kugel Fuhr
dd27ec8696
When creating a VICE label file, replace characters in labels that VICE
...
doesn't understand with '_'. Fixes #836 .
2025-07-03 08:54:10 +02:00
Kugel Fuhr
070276a1a3
Add a better description for CPU_HAS_ZPIND and CPU_HAS_STZ.
2025-07-01 20:19:19 +02:00
Kugel Fuhr
12bc6ff99e
Make the scrcode macros handle identifiers.
2025-07-01 20:14:34 +02:00
Kugel Fuhr
b65ee13e8c
Fix the tests.
2025-07-01 17:46:39 +02:00
Kugel Fuhr
ec67b49d7d
Change notification message used when pointing to the macro an error comes from.
2025-07-01 17:37:39 +02:00
Kugel Fuhr
64d35b6a86
Allow comments within _Pragma(). Fixes #2231 .
2025-07-01 17:24:24 +02:00
Kugel Fuhr
60ec9045fc
Use CPUIsets from cpu.c instead of recreating the CPU_xxx constants.
2025-07-01 13:02:15 +02:00
Kugel Fuhr
37414199c7
Hopefully fix windows build files.
2025-07-01 09:33:38 +02:00
Kugel Fuhr
c162f6a286
Warning fix.
2025-07-01 09:21:18 +02:00
Kugel Fuhr
8d3112e24f
Small code simplification.
2025-07-01 08:47:16 +02:00
Kugel Fuhr
29c8846f7d
Add an additional hook (currently unused) for target specific capabilities.
2025-07-01 08:44:13 +02:00
Kugel Fuhr
59e7158512
Make the CPU_xxx constants from cpu.mac internal to the assembler and replace
...
cpu.mac by a file that just emits a warning when used.
2025-07-01 08:29:42 +02:00
Kugel Fuhr
c72126e68f
Changed most of the library sources to use .CAP instead of .CPU.
2025-07-01 08:04:00 +02:00
Kugel Fuhr
f333b300f1
Added the CPU_HAS_BITIMM capability.
2025-07-01 07:16:33 +02:00
Kugel Fuhr
d4e57278c6
Add a new .cap pseudo function to the assembler that allows to check for
...
certain capabilities of the CPU or target system.
2025-06-30 21:37:43 +02:00
Kugel Fuhr
a4a24280f2
Do only check .c and .h files.
2025-06-30 20:50:30 +02:00
Kugel Fuhr
d5e7c94eb2
Introduce an optimization for (header) files containing include guards: If
...
such an include guard exists, the file is not read and parsed multiple times
(as before) but duplicate inclusion is detected before opening the file and
the additional overhead is avoided.
2025-06-26 10:10:11 +02:00
Kugel Fuhr
e2a39d076d
Renamed the assembler test.
2025-06-26 09:00:03 +02:00
Kugel Fuhr
399f5aaab7
Check that there are no library modules that use the old "sp" symbol instead
...
of "c_sp".
2025-06-26 08:23:51 +02:00
Kugel Fuhr
5db2aed129
Allow "sp" as an alias for "c_sp" for backwards compatibility. Using it will
...
work but generates a linker warning. Added a test to check for this warning.
2025-06-26 07:40:04 +02:00
Kugel Fuhr
fa81f14cbf
Add an explicit "exit 0" to the shell scripts. This worked more or less by
...
coincidence before since shell scripts return the exit code of the last
command run if there is no explicit exit statement.
2025-06-25 20:34:41 +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
1feeee9ce0
Do only check .c and .h files.
2025-06-25 09:37:58 +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
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
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
Kugel Fuhr
e949fbdbbf
Unify CPU list in the docs.
2025-06-22 20:36:30 +02: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
Kugel Fuhr
758bdaa4ad
Fixed a typo in the test source.
2025-06-19 17:59:30 +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
Kugel Fuhr
e4b610994c
Fix #2694 . Also reformatting of long comments and refactoring of a small piece
...
of code.
2025-06-16 16:01:56 +02:00