Start New Discussion within our Software Development Community

So, I've learned my lesson in the past. I'm not experianced enough to design a program from start to finish in an elegant way. I'm not looking for code in any way, just some code flow suggestions if anyone has any. This is what I'm trying to do:

-Do a disassembled hex dump of some binary file
-Filter the text file to conform with the format of a SPIM assembly file
-copy filtered code into a new file

so.. I have a few files with contents like this:

Disassembly of section .text:

00400130 <__start>:
  400130:	3c1c1002 	lui	gp,0x1002
  400134:	279ca240 	addiu	gp,gp,-24000
  400138:	0000f821 	move	ra,zero
  40013c:	3c040040 	lui	a0,0x40
...
Hex dump of section '.data':
  
  0x10000010 00000000 10012234 00000000 00000000 ......"4........

and I want to turn it into something like this:

.text

main:  lui	$28,0x1002
       addiu	$28,$28,-24000
       move	$31,0
       lui	a0,0x40
...
              .data 0x10000010
       .word 00000000
       .word 10012234
       .word 00000000
       .word 00000000
...

Any Ideas about how to get this done? I basically just have to read a bunch of strings, convert things like "rsp" to "$29", chop out anything I don't need like "Disassembly of section .text:" , and I have to add lines like ".text" and so on. I plan on doing this with a bunch of vector functions. Are there any roads you can keep me from going down in this process?

> Are there any roads you can keep me from going down in this process?
Unless failure means big money loss, Edward prefers to throw juniors to the wolves. The school of hard knocks is the most effective one, after all. :D Try designing and writing the program yourself once, then you can ask for ways to improve it.

This article has been dead for over six months. Start a new discussion instead.