6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 12:48 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Apr 12, 2020 12:36 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
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.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 12, 2020 7:50 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Looks like a bug to me! Does it perhaps double the offset? I wonder if it's been ported from a version which deals with 16 bit words, or something like that.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 12, 2020 10:31 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
I think most of us rely on White Flame's wfdis tool.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: