Jump to content
IGNORED

DIS6502 - The Interactive 6502 Disassembler


Recommended Posts

  • 3 weeks later...
5 hours ago, tschak909 said:

@JAC! what is the output format for dis6502? What can I use to re-assemble? I want to use this to modify and extend a game for #FujiNet.

-Thom

 

Hi Thom. The output format is configurable and there are several presets named "profiles" included for MADS and other assemblers. You can change and tweak the output format at any time and export the listing again.

image.thumb.png.514c8c4a4a0a46d61d7ccd4620e1947f.png

 

 

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

@JAC! what toolchain are you using with this? 

 

Each of the profiles have weird inconsistencies in them, e.g. the MADS profile lacks dots for the BYTE/WORD/etc directives, which I will correct and push up for a pull request.

 

But I am really confused as to why, even if I am assembling exactly the same code, why am I not getting the same binary back (much less one that actually runs)

 

-Thom

 

Link to comment
Share on other sites

1 hour ago, tschak909 said:

@JAC! what toolchain are you using with this? 

 

Each of the profiles have weird inconsistencies in them, e.g. the MADS profile lacks dots for the BYTE/WORD/etc directives, which I will correct and push up for a pull request.

 

But I am really confused as to why, even if I am assembling exactly the same code, why am I not getting the same binary back (much less one that actually runs)

 

Best to do binary diff and find a mismatch. I am thinking of creating a cross platform diff utility for xex files, but perhaps it already exists.

Link to comment
Share on other sites

Two zero page addresses are accessed with 16-bit addresses by CTF which is optimized away by MADS.

 

1st one:

L55AC       dec L0000
            .byte $00
            cpy.a L00CE	; add .a to mnemonic
            .byte $00
L55B3       cpy L0085

2nd one:

            sta LB6A2,Y
            cpy.a L00F3	; again add .a
            .byte $F3
L5B4F       jsr L0820

 

Btw.: Your cmp output did not help because you cannot really "see" anything usefol from it.

For binary diffs I use "Beyond Compare" which unfortunately is not free. It costs US$ 30 at least.

 

Then you immediately see that all different bytes differ by a value of 2 - because your binary is two bytes shorter. And by scrolling down, you can also spot the two gaps with the missing data.

 

A free utility is WinMerge, but it only works well with text files. Therefore you need to convert the binary into a hexdump; and to receive useful results it may only contain data bytes (and no address info which usually is at the beginning of every hexdump line).

Edited by DjayBee
added tool info
  • Like 2
Link to comment
Share on other sites

I've been going through the disassembly, using DIS6502, and marking up the data sections as best as I can. I believe that "odd" section referenced above is just some data table. it's referenced in other parts of the code. Assigning the "byte" type to that section, seems to straighten it out:

 

1168257023_ScreenShot2021-01-04at11_55_09AM.thumb.png.12dfa7ff90456e2615cedb1e9e142bdd.png 

 

There's definitely all kinds of weirdness going on in this code. Setting up the display list uses several subroutines, just to put the right values into memory, instead of just defining it inline, for example.

  • Like 1
Link to comment
Share on other sites

16 minutes ago, tsom said:

I believe that "odd" section referenced above is just some data table.

I think, you are right. The only reference to this label is an LDA L55AC,Y

 

16 minutes ago, tsom said:

Setting up the display list uses several subroutines

Could this be because it is mirrored from top to bottom to save RAM and CPU? Means the top and bottom point to identical memory, and also the center part. I believe to have read somewhere about this.

Edited by DjayBee
Link to comment
Share on other sites

  • 10 months later...
  • 2 weeks later...
On 12/3/2021 at 5:56 AM, marcokitt2000 said:

Hello Peter and Eric,

 

Is there any updates comming to dis6502?

 

Gr.

Marco

Hello Marco. Sorry nothing new here. Visiting Fujiama and SillyVenture parties was the only Atari related thing my job allowed me to do this year. Hard to believe one year has already passed...

Link to comment
Share on other sites

36 minutes ago, JAC! said:

Hello Marco. Sorry nothing new here. Visiting Fujiama and SillyVenture parties was the only Atari related thing my job allowed me to do this year. Hard to believe one year has already passed...

Hello Peter,

Thanks for the info i saw that has for 2 months make some opdates on sourceforge.

Thats why i ask if there some updates. But take the time you needed iam now in 3d printing.

All other atari things is now low level.

 

Gr. Marco

Link to comment
Share on other sites

  • 2 months later...

Finally a sign of life from project. Over 60 commits took place meanwhile. Still most of the work is under the hood, yet I feel this is worth sharing. The following may seen simple, but it was a long hard way from DOS plain C with pointers and fixed array sizes everywhere and logic interwoven with WIN32 API calls and UI parts ..

Old.thumb.png.390798e377e320864b54e7567fa20a08.png

to the code without fixed limits (number of segments, size of labels, ..) , without char pointers and instead with standard libararies and the lasted C++ 20 features (type inference, bounds checking).

New.thumb.png.9b4192c76b3cc6ddc8eb38fa5ccc70ed.png

 

But what does that mean?? This means I can now finally write tests for all the essential parts and run them automatically, instead of clicking though the UI. This will bring back the confidence in that all the changes have the correct results, simplify tracing and fixing bugs and it will help make the project more and more stable over time.

DIS6502-TestWorkspace.thumb.png.4a21bc422545654b4c2c5acee24c8d83.png

 

 

 

  • Like 6
Link to comment
Share on other sites

Hello Peter,

 

Thanks for all the good atari programming and thanks for do this project.

Dis6502 can be a very easy tool to handel all atari 6502 machine languages to dissassembler it to a source asm code. To learn from it how it is build up or update the code make it smaller faster etc or debugging.

 

Is there a windows test version yet?

 

Gr.

Marco

Link to comment
Share on other sites

18 hours ago, marcokitt2000 said:

Hello Peter,

 

Is there a windows test version yet?

 

Gr.

Marco

Hello Marco. Today I've managed to fix the bug when reading old workspaces, I was able to load a large example and click around. The new daily is uploaded to https:/www.wudsn.com/productions/windows/dis6502/dis6502.zip . If you find something, please send a PM.

  • Like 1
Link to comment
Share on other sites

15 hours ago, JAC! said:

Hello Marco. Today I've managed to fix the bug when reading old workspaces, I was able to load a large example and click around. The new daily is uploaded to https:/www.wudsn.com/productions/windows/dis6502/dis6502.zip . If you find something, please send a PM.

Thnxxx Peter,

 

I will test it soon i am busy with a 3d printer and learning playing on digi piano.

 

Gr. Marco

 

Link to comment
Share on other sites

On 2/15/2022 at 11:52 PM, JAC! said:

Hello Marco. Today I've managed to fix the bug when reading old workspaces, I was able to load a large example and click around. The new daily is uploaded to https:/www.wudsn.com/productions/windows/dis6502/dis6502.zip . If you find something, please send a PM.

Hello Peter,

 

I download the latest 16 feb round 1.11am from your web site. When i use file open or add image file ex ... from atr image and select dos 2.5 file it doesn work. doesnt load file and dissassembed not.

 

 

Greatings Marco

 

Link to comment
Share on other sites

On 2/17/2022 at 10:04 PM, marcokitt2000 said:

I download the latest 16 feb round 1.11am from your web site. When i use file open or add image file ex ... from atr image and select dos 2.5 file it doesn work. doesnt load file and dissassembed not.

 

Haha, thanks for pointing me to the "box of pandora"... the code for handling ATR files and DOS 2.5 file systems. I had never really used that (only tested .XEX/.BIN) and ended up reworking it completely now. It is now complemented with a set of unit tests that will test 8.3 filename conversion, read 3 reference ATRs, compare the directories, compile the file sizes and contents with the reference content. So in case there anything still does not work, it can now be found quickly. Also all file related dialogs require much less code now.

https://sourceforge.net/p/dis6502/git/ci/master/tree/src/systems/atari800/AtariDiskImageTest.cpp

 

Daily is updated.

ATR-File.png

Link to comment
Share on other sites

4 hours ago, JAC! said:

Haha, thanks for pointing me to the "box of pandora"... the code for handling ATR files and DOS 2.5 file systems. I had never really used that (only tested .XEX/.BIN) and ended up reworking it completely now. It is now complemented with a set of unit tests that will test 8.3 filename conversion, read 3 reference ATRs, compare the directories, compile the file sizes and contents with the reference content. So in case there anything still does not work, it can now be found quickly. Also all file related dialogs require much less code now.

https://sourceforge.net/p/dis6502/git/ci/master/tree/src/systems/atari800/AtariDiskImageTest.cpp

 

Daily is updated.

ATR-File.png

Thnxxx i will test it later.

Gr. Marco

Link to comment
Share on other sites

7 hours ago, JAC! said:

Haha, thanks for pointing me to the "box of pandora"... the code for handling ATR files and DOS 2.5 file systems. I had never really used that (only tested .XEX/.BIN) and ended up reworking it completely now. It is now complemented with a set of unit tests that will test 8.3 filename conversion, read 3 reference ATRs, compare the directories, compile the file sizes and contents with the reference content. So in case there anything still does not work, it can now be found quickly. Also all file related dialogs require much less code now.

https://sourceforge.net/p/dis6502/git/ci/master/tree/src/systems/atari800/AtariDiskImageTest.cpp

 

Daily is updated.

ATR-File.png

 

 

Ok i test it with a atr from me not working. see foto error.

 

Gr. Marco

 

fail to load atr file.jpg

atari utilities A.ATR

Edited by marcokitt2000
atr file insert first file dos 2.5 works dos 2.0 not etc
Link to comment
Share on other sites

File handling of the input stream and the pasers for reading XEX and other file types has been revised. Now, instead of simply returning "false" and a generic error message like "is corrupted or contains more then 4096 segments", you now get a specific error message for every error situation. The texts are not yet great, but there is a different text not for every error which should already be helpful. With this instrumentation you can see that in the sample file given above there is a file with broken DOS file links (corrupted file) and one which is valid file, but not a valid XEX file with and $FFFF header. The last file loaded was OK, so no error message.

 

IOExceptions.thumb.png.9a380a2a9e5d7a5de129d052176d2dc6.png

 

Daily is updated.

 

 

UPDATE: Name of the inner EXE and number sectors are now also output in the status message and the message texts have been revised already.
IOExceptions-2.thumb.png.6f77a1b816fb62a8b2babd3db48f45da.png

 

Note that adding freely selected sectors does not yet work. That's next.

  • Like 1
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...
 Share

  • Recently Browsing   0 members

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