Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New disassembler for 6502 & 65816

553 views
Skip to first unread message

Ewen

unread,
Apr 18, 2015, 3:39:23 AM4/18/15
to
Announcing a new Disassembler for the IIgs.

As my tribute to OZ Kfest, I am announcing my latest project…

BrkDown is a desktop WYSIWYG disassembler for the IIgs, and disassembles
to source code from both the 8 data forks, and 16 bit multi-segmented
data and resource forks, of an application or binary file. The output is
optionally in either ORCA/M or Merlin 16 compatible format.

Powerful Functions allow manipulating of the resulting source, so it can
be worked up into valid source code that can be later reassembled.

Many other tools are provided to make working with source files as
painless as possible.

Please download and read the BrkDown PDF Manual for more information on
how BrkDown works, and how to use it.

Both the PDF manual, and the application archive, as well as all my
other software, can be downloaded from my web site:

http://www.speccie.co.uk

Ewen Wannop

Antoine Vignau

unread,
Apr 18, 2015, 11:05:57 AM4/18/15
to
Yeepee, Ewen.
Thanks for that great news,
Antoine

Hugh Hood

unread,
Apr 23, 2015, 1:26:06 AM4/23/15
to
Fellas,

If you've ever used the Sourceror from Glen Bredon's Merlin 8/16 to
disassemble 6502/65816 object files in the hope of generating usable (or at
least understandable) assembler source code, and have found the Sourceror
lacking in features and non-intuitive to use, take a good look at Ewen
Wannop's latest creation -- 'BrkDown' - the Desktop Interface Disassembler.

While I've always been a fan of lean and swift command line interface
programs, there are times when a well-designed Desktop/GUI program can be
the superior tool for the task. Disassembly of unfamiliar object code, I
think, is one of those times.

In a sense, BrkDown is a word processor for object code. It gives windowed
access to an entire object file and allows the user visually to select
(either via mouse or keyboard) sections of the object code and to apply
assembly language 'meaning' to those selections by the use of several
functions, including:

1. Define As Data (Byte/Word/Long Word/Hex Bytes/Binary/DS reserve)
2. Define Strings (pString/cString/wString)
3. Define As Code (Emulated/Native/re-ORG)

Throw in the ability to pre-specify custom labels for certain addresses,
insert comments, insert directives and build generic labels. By that time
you're ready to generate some fairly robust source code (in either Merlin or
ORCA/M format).

Obviously, BrkDown isn't generating the author's original source code
comments, but I understand Ewen is working on that. <grin>


Anyway, to illustrate (I hope), I've included below a few 'before' and
'after' shots from BrkDown:


BEFORE - Raw Disassembly from an AppleWorks TimeOut Application that has
been instructed to load at $2100.

****************************************************************
*
* Disassembled by BrkDown on 4/22/15 10:46:37 PM
*
* Project: TO.ADD52
*
****************************************************************

0000 002100: 4C 78 21 JMP $2178
0003 002103: 0B DC I1'$0B'
0004 002104: 02 DC I1'$02'
0005 002105: E1 26 SBC ($26,x)
0007 002107: 44 DC I1'$44'
0008 002108: 10 00 BPL $210A ; {+00}
000A 00210A: 00 BRK
000B 00210B: 00 BRK
000C 00210C: 0C 41 64 TSB $6441
000F 00210F: 64 20 STZ $20
0011 002111: 46 69 LSR $69
0013 002113: 6C 65 20 JMP ($2065)
0016 002116: 35 2E AND $2E,x
0018 002118: 32 00 AND ($00)


AFTER - Disassembly modified by:
(i) Hex Bytes defined from $2103-2107.
(ii) Single Bytes defined from $2108-210B.
(iii) pString defined from $210C-$2118.
(iv) DS reserve(s) defined from $2119-215E.

****************************************************************
*
* Disassembled by BrkDown on 4/22/15 10:46:37 PM
*
* Project: TO.ADD52
*
****************************************************************

0000 002100: 4C 78 21 JMP $2178
0003 002103: 0B 02 E1 26 DC H'0B02E12644'
0008 002108: 10 DC I1'$10'
0009 002109: 00 DC I1'$00'
000A 00210A: 00 DC I1'$00'
000B 00210B: 00 DC I1'$00'
000C 00210C: 0C 41 64 64 STR 'Add File 5.2'
0019 002119: DS 4
001D 00211D: DS 65
005E 00215E: DS 2



BEFORE - Raw Disassembly from later in the same TimeOut Application.
(note: BrkDown is using the pre-defined custom labels I supplied)

0078 002178: 20 4B 11 JSR MvRightRtn
007B 00217B: 00 BRK
007C 00217C: 7E 87 21 ROR $2187,x
007F 00217F: 54 DC I1'$54'
0080 002180: 00 BRK
0081 002181: 20 00 11 JSR ClearDA
0084 002184: 4C 00 7E JMP $7E00
0087 002187: 20 8A 11 JSR WriteCom
008A 00218A: 48 PHA
008B 00218B: 7E A9 00 ROR $00A9,x
008E 00218E: 8D 85 0D STA $0D85



AFTER - Disassembly modified by:
(i) 2-Byte 'Words' defined from $217B-2180 and $7E03-7E04.
(ii) re-ORG beginning at $2187 (now $7E00).
(iii) 6502 Code defined from $7E05-7E06.

0078 002178: 20 4B 11 JSR MvRightRtn
007B 00217B: 00 7E DC I2'$7E00'
007D 00217D: 87 21 DC I2'$2187'
007F 00217F: 54 00 DC I2'$0054'
0081 002181: 20 00 11 JSR ClearDA
0084 002184: 4C 00 7E JMP $7E00
0087 * Load address changed:
0087 007E00: org $7E00
0087 007E00: 20 8A 11 JSR WriteCom
008A 007E03: 48 7E DC I2'$7E48'
008C 007E05: A9 00 LDA #$00
008E 007E07: 8D 85 0D STA $0D85



This post is obviously too long, and I've really only scratched the surface
here.

If you've ever thought about disassembling a program to see what made it
tick, and have found the existing command line disassemblers a bit
intimidating, give BrkDown a try. I think you'll be pleasantly surprised.

Nice job, Ewen!





Hugh Hood




in article 1m32fyd.1fvz0qjgjwgsmN%spectr...@nospam.com, Ewen at
spectr...@nospam.com wrote on 4/18/15 2:39 AM:

> Announcing a new Disassembler for the IIgs.
>
> As my tribute to OZ Kfest, I am announcing my latest projectŠ

Ewen

unread,
Apr 23, 2015, 3:15:27 AM4/23/15
to
Hugh Hood <hugh...@earthlink.net> wrote:

Thanks for the nice words. You have summed up BrkDown perfectly...

> Obviously, BrkDown isn't generating the author's original source code
> comments, but I understand Ewen is working on that. <grin>

That will be for v2.0, which will be released early next April. You will
simply supply a raw text file, such as the entire works of Shakespeare,
then BrkDown will parse out relevant quotes, and insert them as comments
at approporiate points throughout the code.

Cheers - Ewen

nexus6gsxos

unread,
Apr 23, 2015, 4:15:05 PM4/23/15
to
brkDown:

I have been wanting to take a look at the Plasma Graphics/Sound Code
for many years and have tried several different disa's over the years.

brkDown did a very good job. Thank you Ewen.

Added:
Last night i used brkDown on the No.2 Init, brkDown made it a SNAP.
Thanks again Ewen.

73
James [ve3myz]

Antoine Vignau

unread,
Apr 23, 2015, 4:23:27 PM4/23/15
to
Ewen's Brkdown is as good as his other programs.
I still find The Flaming Bird Disassembler far superior thanks to its interface and scripting features,
av

Ewen

unread,
Apr 24, 2015, 2:59:19 AM4/24/15
to
Antoine Vignau <antoine...@laposte.net> wrote:

> I still find The Flaming Bird Disassembler far superior thanks to its
> interface and scripting features,

I always intended BrkDown to be a simple desktop application, which
would be quick and easy to use. TFBD is for serious coders... :-)

In addtion, BrkDown does a more complete job of disassembling resource
forks than the ORCA Disasm...

Cheers - Ewen

xorxif

unread,
Apr 26, 2015, 11:22:22 PM4/26/15
to
> BrkDown is a desktop WYSIWYG disassembler for the IIgs, and disassembles
> to source code from both the 8 data forks, and 16 bit multi-segmented
> data and resource forks, of an application or binary file. The output is
> optionally in either ORCA/M or Merlin 16 compatible format.
>
> Powerful Functions allow manipulating of the resulting source, so it can
> be worked up into valid source code that can be later reassembled.
>
> Many other tools are provided to make working with source files as
> painless as possible.

What would be the most equivalent thing to BrkDown that runs in Windows?
I've been wanting to explore the inner workings of a lot of Apple II
game code for years. While I suppose I could run BrkDown in an Apple
IIGS emulator, I would prefer the speed of my PC and the quick access to
programs like Ciderpress.

- xorxif

Steve Nickolas

unread,
Apr 26, 2015, 11:54:14 PM4/26/15
to
Maybe something like IDA?

That's what I use for 8-bit stuff.

-uso.

Ewen

unread,
Apr 27, 2015, 2:25:22 AM4/27/15
to
xorxif <-@-.-> wrote:

> What would be the most equivalent thing to BrkDown that runs in Windows?
> I've been wanting to explore the inner workings of a lot of Apple II
> game code for years. While I suppose I could run BrkDown in an Apple
> IIGS emulator, I would prefer the speed of my PC and the quick access to
> programs like Ciderpress.

Why not do as I do, disassemble with BrkDown in your IIgs emulator, then
edit the files in a word processor on the PC? I use TextWrangler on the
Mac, but presumably there is an equivalent word processor designed for
program code on the PC.

Cheers - Ewen

Antoine Vignau

unread,
Apr 27, 2015, 3:13:33 PM4/27/15
to
The advantage of Ewen's s/w is that is runs well and w/o bugs and w/ a great manual!
av

Hugh Hood

unread,
Apr 29, 2015, 12:01:45 AM4/29/15
to
I'll agree with Ewen.

Mark Lim is recommending Notepad++ for Windows for code editing, but if
you're using a Mac with your Apple II stuff, BBEdit/TextWranger make
excellent Apple II assembler editors, particularly if you take advantage of
the custom syntax coloring afforded by using a 'codeless language module'.

Ivan Drucker came up with a fine codeless language module for generic 65C02
assembly. I used it as a starting point (thanks a MEG Ivan!) to add in some
Merlin opcodes and a few other enhancements.

Here's a screen shot of some Merlin code from BBEdit with the
'MerlinAssembler' codeless language module in effect:

<http://home.earthlink.net/~hughhood/MerlinInBBEdit.jpg>


And, here's the language module itself for BBEdit and TextWranger:

<http://home.earthlink.net/~hughhood/MerlinAssembler.plist>

You'll notice that it's XML, and again, that's mostly Ivan's work. I'm
grateful he shared it.



Since Merlin files are 'goofy' text files, I set up a couple of unix filters
to go to and from regular text files within BBEdit.

'Merlin2Txt' looks like:

#!/bin/bash

# Convert Merlin format to tab-delimited source
# (tabs for high bit spaces; low bit characters)
# Ensure that "Use UTF-8 for Unix Script I/O" if OFF in Text Encodings Prefs

tr '\240' '\011' < "$1" | tr '\200-\377' '\000-\177'


'Txt2Merlin' looks like

#!/bin/bash

# Convert tab-delimited source to Merlin format
# (high bit spaces for tabs; high bit characters)
# Ensure that "Use UTF-8 for Unix Script I/O" if OFF in Text Encodings Prefs

tr '\011' '\240' < "$1" | tr '\000-\037' '\200-\337' | tr '\041-\177'
'\241-\377' | tr '\212' '\215' | tr '\012' '\215'


If you haven't lost interest yet, you'll want to set up an AppleScript to
run the filter and set the tab setting at 15 spaces as well as a few other
interface settings. A hotkey works nicely for all of that in one swoop. I
won't bore you with my AppleScript here.

Finally, don't forget to go into the Preferences for the language module
settings to make sure everything is to your liking. You can change colors
and the like.

We've come a long, long way from the Merlin editor on an Apple II. Thank
goodness!

BTW, don't you just love octals? Just when you've got Hex all figured out.
:-)




Hugh Hood







in article 1m3j0in.ognkeldnh3qqN%spectr...@nospam.com, Ewen at
spectr...@nospam.com wrote on 4/27/15 1:25 AM:

Payton Byrd

unread,
Apr 29, 2015, 12:58:24 AM4/29/15
to
On Tuesday, April 28, 2015 at 11:01:45 PM UTC-5, Hugh Hood wrote:
> Here's a screen shot of some Merlin code from BBEdit with the
> 'MerlinAssembler' codeless language module in effect:
>
> <http://home.earthlink.net/~hughhood/MerlinInBBEdit.jpg>

Boy, you sure got some pretty source code.

D Finnigan

unread,
Apr 29, 2015, 3:41:45 PM4/29/15
to
Hugh Hood wrote:
>
> We've come a long, long way from the Merlin editor on an Apple II. Thank
> goodness!

Bah, I use the Merlin line editor to write Marina on my platinum Apple IIe.

>
> BTW, don't you just love octals? Just when you've got Hex all figured out.
> :-)

Bah!

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/

Michael J. Mahon

unread,
Apr 29, 2015, 7:52:54 PM4/29/15
to
D Finnigan <dog...@macgui.com> wrote:
> Hugh Hood wrote:
>>
>> We've come a long, long way from the Merlin editor on an Apple II. Thank
>> goodness!
>
> Bah, I use the Merlin line editor to write Marina on my platinum Apple IIe.
>
>>
>> BTW, don't you just love octals? Just when you've got Hex all figured out.
>> :-)
>
> Bah!

Agreed! I have no problem with the Merlin editor, and I consider octal a
relic from the pre-8-bit byte era.

Anything that slows down the code edit/compile/test cycle allows more time
for thinking, which is the real "secret sauce" of programming!

Put another way:

More code ~= better code.

(I'm not *completely* serious, but I'm not just kidding, either. ;-)
--
-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon

mdj

unread,
Apr 29, 2015, 10:12:11 PM4/29/15
to
On Thursday, 30 April 2015 09:52:54 UTC+10, Michael J. Mahon wrote:

> Anything that slows down the code edit/compile/test cycle allows more time
> for thinking, which is the real "secret sauce" of programming!
>
> Put another way:
>
> More code ~= better code.
>
> (I'm not *completely* serious, but I'm not just kidding, either. ;-)

I find this sentiment to be both exactly right and yet completely wrong ;-)

Slowing down the cycle inevitably means less time spent testing, and I find I have to do the testing first, then do the thinking ...

In another sense, a complex piece of code that mostly works may stay as it is, if the overheard of the build/test cycle is too high to risk spending time refactoring.

That said, for modest assembly language programming projects, if you find the Merlin edit/assemble time to be too constraining, you need a better Apple II, not a better editor.

Matt
0 new messages