Re: Looking for a2c converting tool

ryer@harp.camb.inmet.com (Mike Ryer)
Thu, 28 Sep 1995 15:53:50 GMT

          From comp.compilers

Related articles
Looking for a2c converting tool Bernd.Reh@RbgS413.Rbg1.Siemens.SCN.DBP.DE (Bernd Reh) (1995-09-22)
Re: Looking for a2c converting tool ryer@harp.camb.inmet.com (1995-09-28)
| List of all articles for this month |

Newsgroups: comp.compilers,comp.lang.c,comp.lang.misc
From: ryer@harp.camb.inmet.com (Mike Ryer)
Keywords: assembler, C, translator, comment
Organization: Intermetrics, Inc.
References: 95-09-140
Date: Thu, 28 Sep 1995 15:53:50 GMT

Depending on your objectives, you might consider the following. It can yield
portability and tracability to the original assembler, but it ain't pretty:


Declare in C a bunch of ints named R1, R2, R3 ... <number of regs on hardwre>
Declare an array of ints to correspond to memory
Define a macro for each machine instruction (the "Load Address(1,2,3)"
    macro might expand to R1 := R2+3, for example. Pardon my syntax.
Make global changes to munge the assembly syntax into C, if required
Keep the assembly source, with comments, and optimize, optimize, optimize.


Like I said, not pretty, but ...


-- Mike "there's no kluge like an old kluge" Ryer
[I once got a beta version of an 8086 to C decompiler that worked that way.
Didn't seem terribly useful, but in extremis ... -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.