[NTLK] ROM Disassembly online?
mm at matthiasm.com
Thu Apr 2 23:15:26 EDT 2015
Very cool. Thanks, Steven. I will try to find the time today to modify the output of Albert, so we can test this on a lager scale. We will need a second script to split code and comments as well.
RomCom, what a great name. LOL!
> On Apr 2, 2015, at 7:43 PM, Steven Frank <stevenf at panic.com> wrote:
> OK, I think I have a script that will do what you've described below. Check it out?
> https://github.com/panicsteve/newton-romcom <https://github.com/panicsteve/newton-romcom>
> I've only tested that it works with your example below. If the script needs debugging as the comments file gets more complex, let me know! (Or just file an issue on GitHub, I guess?)
>> On Apr 2, 2015, at 5:04 AM, Matthias Melcher <mm at matthiasm.com> wrote:
>> How about this:
>> Every line that refers to a fixed address in ROM has the TAG sequence "_@[xxxxxxxx]" ('_' is a space or a tab, 'x' is an upper case hex digit) somewhere. Now we only allow two kinds of comments:
>> 1: inline. The line has a TAG and end in a comment. Those comments are either "_@@ Text", or "_@@@ Text" . Neither Sequence appears in the ROM
>> 2: above. The line has no TAG, but the first non-comment line has a TAG. Same @@ sequences
>> Maybe this is more obvious if I put that into an example. If I use indicators for 'inline' (-) and 'above' ('), removing the source should get me something like below. Can anyone put that into a script? It would also just be a few lines in C. We can even merge arbitrary packed files by simply concatenating and sorting by the first column 0-9. If two inline comments exist for the same address, they should probably be concatenated, or one should be promoted to an 'above' comment.
>> -------- Without source code:
>> 00000000 ' @@ This is the ROM disassembly, generated by a bunch of fans
>> 00000000 ' @@ Make sure that comments you commit are correct
>> 00000000 ' @@
>> 00000000 ' @@ The ARM CPU jumps here when reset is pressed or when switched on
>> 00000000 - @@ jump to ROMBoot
>> 00000004 ' @@ CPU jumps here if an undefined instruction was found
>> 00000004 - @@ What a funny name for a label
>> -------- With source code:
>> @ label = 'Reset'
>> @@ This is the ROM disassembly, generated by a bunch of fans
>> @@ Make sure that comments you commit are correct
>> @@ The ARM CPU jumps here when reset is pressed or when switched on
>> b ROMBoot @ 0xEA0061A0 - ..a. @@ jump to ROMBoot
>> @ label = '_UndefinedInstruction'
>> @@ CPU jumps here if an undefined instruction was found
>> b VEC_FP_UndefHandlers_Start_JT @ 0x00000004 0xEA680C7A - .h.z @@ What a funny name for a label
More information about the NewtonTalk