Jump to content
IGNORED

DIS6502 3.6 quirk


Recommended Posts

I was trying to disassemble a file I found on a disk I was exploring, and got some weird behavior in dis6502.  I'm using the official release of 3.6, as far as I can tell.  It's 884,224 bytes long and I've been using it for a while now.

 

The target file I'm looking at contains a bunch of small segments.  I don't know why the author did it this way - suspect intentional obfuscation aimed at reverse engineers.  It looks like a valid file though.  It isn't large so I attached it (AUTORUN.SYS).

 

When I drag it into dis6502, it generates many tiny segments, which I believe to be correct.  Len of a segment is typically $18 or $17.  The reason I'm writing this is that when I right click a segment and select "Merge contiguous segments", I get a dialog box "Exception occurred in MainWndProc" with text "Segment index out of range".  It doesn't matter which segment I select.  Also, once this happens, selection of ANY segment, including the innocuous one at the end that just sets INITAD, yields the same dialog box and error message.  So this bug leaves dis6502 in an unhappy state.

 

Looking at the file with a hex editor, it really seemed fine, so I wrote a small python script to combine the mini-segments.  It worked, which both

proves the validity of the file and let me load it into dis6502 in usable form.  I attached the output of my script as well - two segment files that add up to content equivalent to AUTORUN.SYS (seg.1 and seg.2).  Those load fine, but I seem to remember older versions of dis6502 being able to do the merging without an external tool.  If you load them both into a single dis6502 instance, what you get is logically equivalent to what you get if AUTORUN.SYS is loaded but without the cruft, which allows for a much nicer disassembly.

 

So I'm not stuck, I just wanted to report the bug.  I don't see it on the list in dis6502.txt.

 

I spent some time getting 3.6 to build under VS2019, and made a version that doesn't need the XP junk, but feel like that's not useful to the community as the actual authors are already working on a beta of 4.0.  So I will spare you my adventures with visual studio and just stick to the little bug report.

 

If I'm doing something wrong or violated some sort of atariage.com norm, I'm sure I will be duly informed.  :)

AUTORUN.SYS seg.1 seg.2

  • Like 1
Link to comment
Share on other sites

Regarding the many small segments. MAC/65 for example creates many segments, but more between 100 and 252 bytes (mostly 252). But it could be that another assembler generates these 22-24 bytes long segments in AUTORUN.SYS. So maybe not a conscious decision by the author.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...