

                   6502DIS - Another 6502 disassembler

                       Copyright (c) 1997 RGR

                            User's Manual


What is it?
-----------
 6502dis is a disassembler which will disassemble 6502 machine code. It
attempts to `follow' the code, thus separating between code and data.

It has also build-in support for `Acorn-like BRK opcodes'. Acorn's 6502
based machines (BBC, Electron, Master, not the Atom) mostly use the BRK
opcode as an indication that an error message follows. Their routine in
the OS displays this message on screen, whenever a BRK opcode has been
encountered. The format is as follows:

  xxxx      BRK
  xxxx+1    <error code>
  xxxx+2    <error message of length L>
  xxxx+3+L  BRK

6502dis has an option to treat BRK's this way, but as it can also deal
with them the normal way it's still useful for disassembling routines
of other 6502 based machines.

Illegal opcodes are not supported and are shown as `???'.

So, now you know what it is you don't have to read the rest of this doc
to be able to use it. But it might be handy...


How do I use it?
----------------
 As 6502dis doesn't support parameters yet, you simply have to run it
and answer all of its questions - there aren't that many.

Here's a sample session:

C:\>6502dis

6502DIS Version 0.12
Copyright 1997 RoGeR

Filename : os1elk.rom
Output [OS1ELK.DIS] :
Treat as pageable Acorn ROM (y/N) ? No
Loadaddr : $C000
Entry at [$C000] : $D8D2
Treat BRK's Normally or Acornlike (N/a) ? Acornlike
Symbol file [None] :
Skip data (y/N) ? No, include data
Addr $C000 - $FFFF, $4000 = 16384 bytes.

o Tracing...Ok
o Disassembling...Ok

File OS1ELK.DIS written.


In case you haven't already figured out how it works by now,
this is what it means:

Filename : _

You have to specify the filename of the file which you want to
disassemble. If you simply press Enter, 6502dis will return to DOS.

Output [<filename.dis>] : _

You now have to specify the file where to send the disassembly to. By
default, the name is the file to be disassembled with the extension
.DIS. Pressing Enter will take this filename, but you can also enter one
by your self.

Treat as pageable Acorn ROM (y/N) ? _

Pageable Acorn ROMs are ROMs loaded into an Acorn system (paged in)
from $8000 to $C000. Up to 16 different ROMs could be loaded this way.
If you think/know for sure your file is such a ROM, answer Y. The load
address will then be set to $8000 automatically, and BRKs will be
treated the Acorn way. Otherwise, press N.

Loadaddr : _

What is the load address of the file in the memory of the micro it came
from. This is very important, as you might get a rather useless
disassembly otherwise.

Entry at [$C000] : _

Where do you think the code starts? If you don't know, simply press
Enter and the load address will be taken. If the disassembly is very
short (or looks like garbage) you have to try to find another address.

Treat BRK's Normally or Acornlike (N/a) ? _

Easy enough, see top of this document.

Symbol file [None] : _

This is a rather handy feature. You can specify a symbol file, written
with any normal ASCII-editor, such as MS-DOS Edit, Notepad, whatever.
You can use this file to give names to certain routines. Say, a routine
in the OS at $FFEE is called OSWRCH, then, whenever 6502dis finds a
JSR $FFEE (or a JMP there), it will change this in the disassembly to
JSR OSWRCH. For the format of the symbol file, see further on.

Skip data (y/N) ? _

Do you want to include data found between successive parts of code, or
do you want to skip them. As this `data' might be other routines,
these parts might get pretty long.


Format of symbol file:
----------------------
 This is quite easy. Any line starting with a semi-colon (;) is treated
as a comment. The format of the other lines is: <address> <name>
Addresses may be preceded by a '$'-sign, thus indicating an address
given in hex. Example:

; This is an example symbol file.
; Okay, here we go!

$FFEE oswrch
$FFF4 osbyte
65521 osword

; And so on...


Last things:
------------
o There are times the disassembler doesn't seem to stop. It doesn't
  happen that very ofthen, but I know of a file which doesn't seem to
  get disassembled correctly. If this happens, just press Ctrl-C
  or Ctrl-Break and you'll be back in DOS (I think...).
o 6502dis uses a temporary file (6502dis.$$$) which is just as large
  as the input file. If that's a pretty long one, don't go disassembling
  on a floppy! It might take a good while before it's finished...
o Sometimes when you specify an entry-address at the end of the file,
  and have chosen to include data, you might not find any preceding
  data in the disassembly at all. In fact I think this really IS a
  bug... ;)
o 6502dis is written entirely in Turbo Pascal 7.0. The source code is
  included.
o You may use this program at your OWN risk. I couldn't think of anything
  that might go wrong, but just in case: anything happening to you, your
  PC or your dog by using this program is YOUR problem. I cannot be held
  responsible for these and other things. Phew! That feels better...

Okay, that's it. I can be reached at my email address. As I currently
study at university, I might not always be there during the summer
holidays, so a reaction from my side might take a while.

--- Wouter Hobers
--- w.hobers@wing.rug.nl
(RGR is just a nickname)

Very very very last:
--------------------
 I have no connection whatsoever with Acorn Computers Ltd. Their name is
only being used because I have two Electrons and I wrote this program
mainly to disassemble parts of their operating system.

Hope they don't mind...
