Ok, here's the setup:
Code written and assembled with Kowalski Simulator (love this software BTW)
Using a HP 1670E logic analyzer to debug code as it runs on my hardware
I'm using a 6502 inverse assembler. Can't remember where I got it, but if I recall it was the only one I could fine free on the interwebs.
Here is the question. On branch instructions, the inverse assembler shows me both the address I'm branching to, and the offset from the program counter. The offset value is always what I expect. The actual address displayed is wrong. Is this a bug in the inverse assembler, or an aspect of things I don't understand?
Here is an example:
My code says
Code:
BNE no_column_reset
the no_column reset label is $82B0. This is according to the Kowalski label window, and confirmed with the logic analyzer
The inverse assembler says that the quoted line of code is at address $829B. This is confirmed to be true.
The inverse assembler decodes this as "BNE $82C3 (+13)". Since BNE is a 2 byte instruction, $13 + $02 + $829B is indeed $82B0. Thus, the offset shown is correct. This makes sense, since the offset is what the instruction actually contains, not the full address. The address shown ($82C3) is wrong.
So is the address shown by the inverse assembler a bug in that IA, or some phenomena I don't know about?
This doesn't cause problems, but is just an annoyance.