WFDis - 6502/65C02 interactive disassembler

Programming the 6502 microprocessor and its relatives in assembly and other languages.
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

Alrighty, I added in importing label files. From the docs:
Quote:
A file defining labels can be imported, which affects only the current overlay. VICE label files (which can be generated by ca65) are supported, as well as a more freeform syntax. Semicolons indicate comments.

Sample lines:
  • al 000801 .foo ; VICE format, hexadecimal and an ignored dot
  • foo: $0801
  • foo = 2049 ; Freeform syntax defaults to decimal
  • foo EQU $0801
The regex for separating label & address is (=|:| \.?[eE][qQ][uU]? ) which should support enough variation for common cases.
The keystroke is Shift-I, and the labels will be imported into whatever overlay the cursor is on.

Let me know if there are any bugs, and thanks for using it!
User avatar
Konrad_B
Posts: 27
Joined: 11 Sep 2007
Location: Pruszków/Poland

Re: WFDis - 6502/65C02 interactive disassembler

Post by Konrad_B »

Quick test with "label: $ADDR" formatted files - works nice.

Thanks for adding this :)
Practice safe HEX !
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: WFDis - 6502/65C02 interactive disassembler

Post by Chromatix »

There seem to be a few opcodes that WFDis has trouble decoding, such as 0x58 (CLI). For example:

Code: Select all

; raw bytes
28 58 08 68 48

; disassembly by WFDis
plp
$08,L0a9e
pha

; true disassembly (by hand)
plp
cli
php
pla
pha
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

I tried those bytes but didn't have any problems until I went through the list of CPU models, and the ones with the bit operations seemed to do that. I'll look into it.
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

Had a bungled parameter in initializing the bitop instructions, it's fixed now.
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: WFDis - 6502/65C02 interactive disassembler

Post by Chromatix »

Okay, maybe some of the things I've previously tried to disassemble will make more sense now.
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

Having spent some time in profiling, rendering is now 40x faster, meaning a "large" file that took 200 seconds to load into the workspace now takes 5 seconds, making this MUCH more useful for Real Work™.

As always, it's still experimental and bug reports are welcome. Merry Christmas!
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: WFDis - 6502/65C02 interactive disassembler

Post by Chromatix »

Looking good in my tests. It loads the 64KB 6502-test images much faster than before.
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: WFDis - 6502/65C02 interactive disassembler

Post by Chromatix »

A rather glaring omission so far is the ability to interpret bytes as ASCII text, rather than PETSCII. The latter is only relevant to Commodore machines, the former rather more broadly.
Attachments
Screenshot 2020-04-17 14.33.48.png
kgreene
Posts: 7
Joined: 19 Nov 2005
Contact:

Re: WFDis - 6502/65C02 interactive disassembler

Post by kgreene »

I recently found this when looking for a way to work on disassembling an apple II binary.

Is there a way to export raw text of the disassembly? The dump appears to save an internal binary format.

thanks
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

Not currently. And yes, the current save format is a compressed version of the entire workspace, retaining all the editable state.

Exporting to text is weird given all the display options, address overlaps/overlays, and assemblers out there. So as a stopgap, I ensured that copy/paste is sane, keeping linebreaks and not including the address prefixes.

Selecting all with Ctrl-A, Ctrl-C and pasting into a text editor gives a very usable text dump.
kgreene
Posts: 7
Joined: 19 Nov 2005
Contact:

Re: WFDis - 6502/65C02 interactive disassembler

Post by kgreene »

OK, that seems to be working now. I tried it several times and it just kept copying the URL (even clicking in the window, etc) but now it seems to work. Not sure what was going on.

Not sure if you are actively developing this still, any plans for enhancements?

thanks
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

I'm working on back-end AI stuff, which is taking pretty much all my time, and will feed into WFDis. I definitely am planning big enhancements, but they need a lot of core work done.

Certainly as users poke at me, that will keep smaller iterative changes coming as well. ;) But I really should add the suggestion to copy/paste into the help pane.
kgreene
Posts: 7
Joined: 19 Nov 2005
Contact:

Re: WFDis - 6502/65C02 interactive disassembler

Post by kgreene »

One feature that would be nice is to auto-split text blocks on return into separate strings. (ie, an alternate to the existing, shift-T or something).

For now the petscii is working for me as ascii uppercase text.
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: WFDis - 6502/65C02 interactive disassembler

Post by White Flame »

A front-end feature I want is nested keystroke menus, because I'm quickly running out of sane standalone keybindings. But I'll bang something in soon.
Post Reply