[NTLK] ROM Disassembly online?

Matthias Melcher mm at matthiasm.com
Wed Apr 1 23:46:53 EDT 2015


> On Apr 1, 2015, at 9:36 PM, Steven Frank <stevenf at panic.com> wrote:
> 
> Sorry to spam the list but as I read your email again I think I still misunderstand the ultimate goal. 
> 
> As I understand it, your existing Albert tool takes a ROM file and a symbol file as input and outputs a symbolicated disassembly that can be reassembled as-is into a new ROM. 
> 
> So I'm unclear.. What you are proposing sounds like what we already have. :)

> Could you unpack this a bit more for me:
> 
> "The idea is to upload the comments only, and use a modified assembler to add the ROM code when needed, and to remove the ROM code before pushing any additional comments and findings to git"
> 
> A concrete example would probably help me get it. :)


OK, let's say that the disassembler spews this out:




Init__10TIdleTimerFUl9TimeUnitsN21:             @ 0x00025464: TIdleTimer::Init(unsigned long, TimeUnits, unsigned long, unsigned long)
        @ label = 'Init__10TIdleTimerFUl9TimeUnitsN21'
        @ ARM R0 = type: 'unsigned long'
        @ ARM R1 = type: 'TimeUnits'
        @ ARM R2 = type: 'unsigned long'
        @ ARM R3 = type: 'unsigned long'
        @ name = 'Init'
        @ class = 'TIdleTimer'
        mov     pc, lr                          @ 0x00025464 0xE1A0F00E - ....



Next, any one in the group decides that this is important and adds comments (mine start with @@ or @@@):



@@@ \brief Initialize the idle timer
@@@ Actually, the real timer is a derived class, so there is no code needed here
@@@ \param a  whatever
@@@ \param b  I don't know
@@@ \return nothing at all
Init__10TIdleTimerFUl9TimeUnitsN21:             @ 0x00025464: TIdleTimer::Init(unsigned long, TimeUnits, unsigned long, unsigned long)
        @ label = 'Init__10TIdleTimerFUl9TimeUnitsN21'
        @ ARM R0 = type: 'unsigned long' @@ actually, the disassembler is wrong: R0 is 'this'
        @ ARM R1 = type: 'TimeUnits'
        @ ARM R2 = type: 'unsigned long'
        @ ARM R3 = type: 'unsigned long'
        @ name = 'Init'
        @ class = 'TIdleTimer'
	@@ the following line simply returns without a return value
        mov     pc, lr                          @ 0x00025464 0xE1A0F00E - ....


Now, we probably should not put the entire code online, but instead just a file containing comments. The comments must be extracted automatically, and re-merged automatically as well. For example, removing the assembler code would give something like:


0x00025464.pre    @@@ \brief Initialize the idle timer
0x00025464.pre    @@@ Actually, the real timer is a derived class, so there is no code needed here
0x00025464.pre    @@@ \param a  whatever
0x00025464.pre    @@@ \param b  I don't know
0x00025464.pre    @@@ \return nothing at all
0x00025464.post+2 @@ actually, the disassembler is wrong: R0 is 'this'
0x00025464.pre    @@ the following line simply returns without a return value


So no information with copyright is ever posted to Github. The important part would be to centralize all comments of everyone who read the code. So we don't do it over and over again.

I know no scripting language well enough to do this. With me, it's always C. (and that even rhymes)


Matthias




More information about the NewtonTalk mailing list