Site hosted by Angelfire.com: Build your free website today!
 

Distella "Tutorial"

Once you've got MPW set up and you're RAsm-ing files, you're well on your way.  All that's left is to get a hang of the dissembler.

A dissembler takes your binary images and turns them back into 6502 assembler code!  This is incredibly useful when you need to make sure RAsm didn't do something weird with your source, or just when you need a version of your program that isn't crowded with tons of comments so that you can take a look at your program "afresh".

So here's how it's done:


You should have already put distella in your Tools folder in your MPW shell's parent directory.  To test, type "distella" in the MPW Worksheet window and hit enter.  A help screen should come up that looks like this (but without all the groovy scribbles all over the place):



For a real dissembly, use the line in the red border, above.  If you don't include a file name for the output, the dissembly will be displayed in the Worksheet window (the file name for the output is "pacman.s" above and is "srn.s" below).

Here's a call to distella to dissemble my demo "screen5.ao":



You'll notice that all that the command wrote to the Worksheet is PASS 1, 2, & 3.  That's because I routed the output to the file that is now on my hard drive (yes, I renamed my hard drive "Robust" to try and trick it into thinking it wasn't the type that crashed) called "srn.s".

Now let's open that new file, srn.s!





Every place you had a jmp or branch in your source now had its line number written out in the left margin.  Here, you can tell branch to line F007 from the BNE command just below.  Remember, your comments and fancy titles for routines are gone!  The binary doesn't waste spa by semi-colons.  DAsm will ignore anything after a semi-colon, so this is where you write things like, "I love programming the Atari," or, "Those Mactari pages aren't worth the hard drive space they're written on!"  Here, there's simply a number.  This shows how many cycles each command takes.  You should have learned about this from the Stella manual and Nick's guide to counting cyclesUsing distella is one of the best ways to figure out how many cycles you've used and to check your counting.

One neat thing about Distella is that the source file is ready to be DAsm'd right away. If you DAsm'd srn.s, you'd have a copy of the bin you dissembled!


And that's it!  You're an expert!  Go to it!  One last thing for which DiStella is excellent:  Dissembling other people's binaries.  There are freeware games that have been recently written up on Nick's site, and as far as I know, the authors would be more than happy for you do dissemble them to see what they've done (if the source isn't already included).

Again, best of luck, and email me or join the Stella mailing list if you have any troubles! ÿ