Skip to content
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

added option (-T2) to order symbols by definition appearance in code #142

Merged
merged 2 commits into from Jun 3, 2023

Conversation

thrust26
Copy link
Member

@thrust26 thrust26 commented Jun 2, 2023

By ordering the symbol according to their definition order in the code, the disassembling can be significantly improved.

Using their own, well defined symbols, the disassemblers and debuggers can group the symbol file. From that grouping, the type of a symbol can be identified (e.g. constant vs. variable). Also in bankswitched code (e.g. Atari 2600), the disassembler will know to which bank a label belongs.

Now:

BLUE = $80
...
var = $80
...
; bank0
LabelFromBank0
  lda BLUE          ; !!!
  lda #BLUE
  ...
; bank1
LabelFromBank0      ; !!!

Future:

DASM_CONSTS
BLUE = $80
...
DASM_ZP_VARS
var = $80
...
DASM_BANK_0
LabelFromBank0
  lda var           ; !!!
  lda #BLUE
  ...
DASM_BANK_1
LabelFromBank1      ; !!!

@dionoid
Copy link
Member

dionoid commented Jun 3, 2023

Changes look good. I like the way this is implemented as new -T2 option, so there won't be compatibility issues.

@dionoid dionoid merged commit 73fc1ab into master Jun 3, 2023
@dionoid dionoid deleted the OrderedSymbols branch June 3, 2023 13:29
@dionoid dionoid linked an issue Jun 4, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance .sym file for bank switching
2 participants