8000 Cleanup for the da65 code base by kugelfuhr · Pull Request #2728 · cc65/cc65 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cleanup for the da65 code base #2728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025

Conversation

kugelfuhr
Copy link
Contributor

This is a large cleanup of the da65 code base removing some of the hacks introduced earlier.

The most important change is the use of hash tables for all data tables that contained one entry per address before. This allows to remove the ugly special casing of "long addresses". In addition to that, I have also introduced fixed size integers for addresses and known target data types. For range errors in the info file, the attribute that contains the invalid value is now printed, so one has no longer to guess which of the attributes is out of range.

The changes do NOT include opening the address space to more than 64KB for the 65816 - this has to be done in a later change.

I wasn't bold enough to remove one other hack since I don't know how often it is actually used: The end of a range may optionally be specified with a '+' sign in front in which case it means an offset to the start. This is not in line with all other groups where a SIZE attribute is used and is quite unexpected since a '-' sign in front doesn't designate an offset.

@kugelfuhr
Copy link
Contributor Author

One thing I forgot to mention: I have changed output for labels and hex numbers > 16 bits. Previously they always had 6 hex digits, now they have as many digits as required (5 or 6 depending on the value). This means that probably most of the far addresses the disassembler will ever see will have 5 hex digits. The reason for the change was that it saves a few lines of code and in addition allows a space between most long labels and the following code which makes it easier to read in my eyes.

Example, new implementation:

L12345: lda     xxx

instead of, before:

L0123456:lda     xxx

This change might be controversial, I can revert it if requested.

@mrdudz
Copy link
Contributor
mrdudz commented Jun 22, 2025

Mmmh. I find numbers (in particular addresses) much easier/quicker to read, when they are in some "natural size", ie 8,16 or 32 bits (even 24bits is weird to me)

Perhaps increase the indention one level, and make them either use 4 or 8 digits?

(But i honestly don't care much)

@mrdudz mrdudz added da65 cleanup Style fixes, Typos etc labels Jun 22, 2025
…cial

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.
@kugelfuhr kugelfuhr force-pushed the kugelfuhr/da65-improvements branch from cb81771 to e949fbd Compare June 22, 2025 18:37
@kugelfuhr
Copy link
Contributor Author

Mmmh. I find numbers (in particular addresses) much easier/quicker to read, when they are in some "natural size", ie 8,16 or 32 bits (even 24bits is weird to me)

I'm pretty sure people will complain if you have every number > 16 bit starting with two unused zeroes.

Perhaps increase the indention one level, and make them either use 4 or 8 digits?

Not really necessary since the disassembler will start a new line if the label is too long to fit on the left side. So you will get

L00012345:
        lda     xxx

for each far address.

@mrdudz
Copy link
Contributor
mrdudz commented Jun 22, 2025

I'm pretty sure people will complain if you have every number > 16 bit starting with two unused zeroes.

Oh someone will complain, no matter what :)

Srsly though, fine with me this way

@mrdudz
Copy link
Contributor
mrdudz commented Jun 23, 2025

thanks!

@mrdudz mrdudz merged commit 540a6a7 into cc65:master Jun 23, 2025
2 checks passed
@kugelfuhr kugelfuhr deleted the kugelfuhr/da65-improvements branch June 23, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Style fixes, Typos etc da65
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0