| |
Mixer
Registered: Apr 2008 Posts: 422 |
ASM to C
Are there tools to convert a) disassembler output to some sort of C? b) macro assembler listings to C?
Such a thing can be done by substituting opcodes with their C-statement equals. Has anyone written more sophisticated tools for this? |
|
... 12 posts hidden. Click here to view all posts.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
Quote:What was the major blocker on basic to C? I would think it mostly has a 1:1 relationship.
not at all. you can do terrible things in basic v2 which just wont translate to C at all. like GOSUB somewhere, but never RETURN. or reuse parts of one subfunction from another. even after building a control flow graph and duplicating the things that would collide, you'd still end up with dead ends. not worth the trouble, easier to just convert by hand :)
Quote:READ would be the tricky part.
no not really, thats one of the easier parts infact :=P |
| |
DanPhillips
Registered: Jan 2003 Posts: 30 |
Yay back on the forum :)
We once used a bunch of macros to convert 65816 to c.
All the object handling/ai was converted when going from Snes to PC dos.
I don't have a copy of the macros, but I do remember they were "horrendous" :)
Cheers
Dan |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
ah i did this once when i converted 6502 code to gameboy :)
however - this doesnt make the code more readable at all =D |
| |
Remdy
Registered: Feb 2019 Posts: 26 |
I did it for (a subset) of DOS/PMODEW 386 TASM assembly code: https://github.com/frranck/asm2c |
Previous - 1 | 2 | 3 - Next |