Re: [cc65] da65 adventures

Date view Thread view Subject view

From: Andre Majorel (amajorel_at_teaser.fr)
Date: 2003-11-05 15:38:50


On 2003-11-03 22:39 +0100, Groepaz wrote:
> On Monday 03 November 2003 17:43, Ullrich von Bassewitz wrote:
> 
> > One main problem lies in code like this:
> > 
> > 	lda	#<table
> > 	sta	ptr
> > 	lda	#>table
> > 	sta	ptr+1
> > 	ldy	offs
> > 	lda	(table),y
> > 
> > The immediate loads do actually use a label, but because the label
> > is broken into two halves, the disassembler is not able to spot it.
> > Changing the code somewhere will break it, because the location of
> > the table changes, but the immediate loads are not updated
> > accordingly.
> > 
> > Are there any disassemblers which are able to spot locations like
> > the one above?
> 
> not that i know... immediate loads, jumptables and self-modifying code
> cant be really automatically found.... i've attempted to add that to
> my own disassembler more than once (it traces code using a cpu core
> simelar to what IDA does) but couldnt ever come up with something that
> would even halfway work :/

This algorithm is relatively slow but if I'm not mistaken, it
will catch simple uses like Ullrich's example:

Scan the source and, when you find an occurrence of (zp),y,
trace the source backwards for up to, say, 50 instructions, to
find writes into zp and zp + 1, and where the values come from.
If both come from an immediate value, generate a label.

-- 
André Majorel <amajorel_at_teaser.fr>
http://www.teaser.fr/~amajorel/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-11-05 15:43:56 CET