Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to convert Motorola ASM code to C code?

Status
Not open for further replies.

snsriram79

Member level 4
Joined
May 8, 2001
Messages
71
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
513
is there any application to convert motorola ASM to C.

i am having a 68hc11 assembly code written by sum1 and it is very difficult to do the reverse engineering.so i thought if there is any software for converting assembly to C

bye
 

assembler to c conversion

I read once some where an explanation on why what you are asking is totally impossible. I don't racall the arguments (something how about compiler optimizations works), only the end statement. Forget it.
 

+assembly to c

I agree with pardal.
I have never heard of an application to convert from assembly to C.
To me, it sounds impossible to make such software.
Several different C statements can generate the same assembly code, so it's impossible to go back from assembly to C.
 

asm to c translator

Hi,

I think that this is very interesting topic for discussion.

There is no need to convert any assembly routine to any HLL (high level language).

When you write and compile some HLL routine you get object code. With linker you link all object files to binary executable. Linker use only object files not HLL routine or assembly source.

You can interface any HLL program with assembly routine using compiled assembly source and function/procedure declaration in HLL program.

In C you can interface assembly routine without passing arguments and return value ussing declaration.

extern void assembly_routine_name()

If you want to convert whole assembly program to C I suggest this code

extern void assembly_start_label();

void main()
{
assembly_start_label();
}

In your assembly source declare program origin assembly_start_label as public to other modules.

assembly_start_label:
.
.
.
end

You need to compile c source and asm source and link object files. So this is whole conversion.

Instead C or Assembly it is better to think about functions and routines.
When you use functions from standard C libraries you don't use sources only function prototypes.

For example you don't know how is char *strcpy(char *s1, char *s2) implemented? Is it C or assembly?It is standard C string function and it's implementation varies from platform to platform.

From programmers point of view it is always same strcpy function.

If you want to convert your assembly program to C to make it portable it is not simple task. If you don't need portability there is no need for any conversion.

Regards
 

asm68c

Hi,

I think that this is very interesting topic for discussion.

There is no need to convert any assembly routine to any HLL (high level language).

When you write and compile some HLL routine you get object code. With linker you link all object files to binary executable. Linker use only object files not HLL routine or assembly source.

You can interface any HLL program with assembly routine using compiled assembly source and function/procedure declaration in HLL program.

In C you can interface assembly routine without passing arguments and return value ussing declaration.

extern void assembly_routine_name()

If you want to convert whole assembly program to C I suggest this code

extern void assembly_start_label();

void main()
{
assembly_start_label();
}

In your assembly source declare program origin assembly_start_label as public to other modules.

assembly_start_label:
.
.
.
end

You need to compile c source and asm source and link object files. So this is whole conversion.

Instead C or Assembly it is better to think about functions and routines.
When you use functions from standard C libraries you don't use sources only function prototypes.

For example you don't know how is char *strcpy(char *s1, char *s2) implemented? Is it C or assembly?It is standard C string function and it's implementation varies from platform to platform.

From programmers point of view it is always same strcpy function.

If you want to convert your assembly program to C to make it portable it is not simple task. If you don't need portability there is no need for any conversion.

Regards
 

reverse string assembly motorola

Well, Hero
Regarding my programing capabilities you jumped a bit further than I can follow. Although i learned something.
The point is that your view of convert assembly to C is very different of what snsriram79 has asked.
He wants an imaginary tool to help him to reverse engeneering his target, but if it was that easy all existing and worthing software would have been already reversed engeneered.
Imagine the consequences of this.
 

convert assembly code to c

hi pardal

thanks for the reply

i asked this doubt after going thru this site

**broken link removed**

kindly go thru this site and tell me ur comments

i think i remeber seeing a translator for asm to C

if this is not that means then forgive me. i just wanted to know if this is a possibility and if possible would like to hav the tool

bye
 

assembler to c conversion procedure

snsriram79 thanks for your confidence but I'm afraid I have to disapoint you.
I don't have enough knowledge to help you on this. I read their description and in fact they claim that the assembler to C conversion is possible with their products, but there is no way to test it (exept asking them to do it).
Other, more pro, incoms on this subject are wellcome. I got curious.
 

interface asm and c

It is allways possible to convert assambler to c .. is a matter of graphs

the questions is wiil the code look like the original code ...

the algorithm that produced the assamblee code is still there ..in the equivalent form ..but is machine dependant .. it was reduced to fit
the machine where it runs ..so there is a lot of junk with it, and also
a lot now missing .Because probably the machine instructions set implements some instructions very powerfully .But still is always possible
to produce the a program that will reverse engineer the code. but once again this program will be machine dependant ..
In other words a decompiler for SPARC will look very diffrent from a
decompiler for a X86 .. and probably nobody will be interested in producing
one for the motorola microntroller .
There is a program called dcc a doctorate thesis that explains it all
i have played a lot with this and i see a lot of opportunities here for crime
see dcc seminal paper
at
**broken link removed**
 

assembler to c converter for 68hc11

The dcc Decompiler has moved to this site: **broken link removed**
 

programa que converte assembler para c

Actually you can buy a Motorola ASM 6811 To C Source Code Translator and Converter from Micro-Processor Services, Inc.
http://www.mpsinc.com

ASM 6811 to C: http://www.mpsinc.com/asm68c.html

ASM 6811 to C++: **broken link removed**

ASM 6811 to JAVA: **broken link removed**

Price and order form: **broken link removed**
 

strcpy in asm

Possibly not useful, but...

back in 1996 I wrote a disassembler for 68hc11.

May be of use. Let me know if it is, and I'll upload the source.
 

convert assembler and c

snsriram79 was asking for a decompiler and not a disassembler, since he already have the assembly code and need to convert this to C.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top