[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 disassembler



Bill Garber wrote:
> BTW, how do you distinguish between data
> and a single byte instruction. I imagine by
> whether the next byte is instruction or not.
> Am I basically correct?

You must give my disassembler at least one
address of valid code to start with.
In my Monitor example, I told the
disassembler to use the NMI, RESET, and
IRQ pointers to valid code.

It traces the code.  Whenever it finds a
JMP, JSR, or branch instruction, it saves
the destination address in a list.

Whenever it finds a JMP, RTS, RTI, BRK, BRA,
or illegal opcode it stops disassembling and
gets an address from the destination list to
continues disassembling.  When it needs
another address but the list is empty,
then it is done.  It goes back through all
the data it collected and writes a
disassembly listing to disk.

--
Paul
Monroe, Michigan USA