6502bench icon indicating copy to clipboard operation
6502bench copied to clipboard

Program starts

Open BacchusFLT opened this issue 1 year ago • 2 comments

My understanding is that ïf a program start is set manually, 6502 bench traverses based on that and that these are store in an array.

Some of functions can add to the program start array - like the "Format address table" - and what then happens is that addresses are added to the program start array. It's basically an automated entry of the same type of starting point. So updating that address table will not remove the program starts inserted, as the program doesn't keep a list of what it set (again - my understanding).

This is not really optimal, as a mistake in the address table definition (like forgetting to set split hi/lo before executing) risks cluttering the source with invalid start points. On the other hand, if you make a mistake and rectify it, one of the erroneous starting points might have been the same as a manually set one, and that would now be removed. Not sure how to mitigate that second scenario - even if that has to be less common than erroneous configurations.

Generally speaking, I see a need to have a look at this. Having an properly automated starting point (as in the address table" example) remove the manually set ones is beneficial, as In an ideal world, you'd only have one manual starting point - the actual start. All other starting points would be based on definitions. But if the automated setting was wrong and you change it, then accidentally killing valud manual starting points is of course not good.

This is a snippet where the JumperLo and JumperHi points to a table slip in Hi/lo that is used to populate the jump.

                ldy   $53             ;3
                lda   Jumper4Lo,y     ;4+
                sta   Jumper4+1       ;4
                lda   Jumper4Hi,y     ;4+
                sta   Jumper4+2       ;4
Jumper4         jsr   L0400           ;6

BacchusFLT avatar Feb 01 '24 00:02 BacchusFLT

The way to fix this is to make address tables be a proper structure that is evaluated during code analysis, rather than a one-time event that formats code. IIRC there's some other stuff that could be fixed if we did this.

fadden avatar Feb 01 '24 02:02 fadden

Makes total sense. If that is made a structure, is that something else than "format address table" and can you manually relaunch code analysis?

BacchusFLT avatar Feb 03 '24 00:02 BacchusFLT

I'm gathering up the address table formatter stuff in issue #160.

fadden avatar Jun 02 '24 15:06 fadden