CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

assembly to C conversion

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
someone
Guest







assembly to C conversion
PostPosted: Tue Nov 28, 2006 5:42 am     Reply with quote

Hi everyone

I was wondering if there is any way to convert an assembly language code into a C code for PIC

Best Regards
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Nov 28, 2006 6:14 am     Reply with quote

This is what we are doing here since many years !!! Mr. Green


Humberto
someone
Guest







PostPosted: Tue Nov 28, 2006 6:27 am     Reply with quote

hmm

Are you being sarcastic and implying that it cant be done?
Guest








PostPosted: Tue Nov 28, 2006 7:05 am     Reply with quote

Forget about low level language to high level language translation.

Not only a dream. It won't be so useful.
Ttelmah
Guest







PostPosted: Tue Nov 28, 2006 7:50 am     Reply with quote

Let's be slightly more informative about this.
There are several different possible combinations:
First 'pure' assembler.
Then assembler that was itself generated by an 'unknown' compiler.
Then assembler that has come from a 'known' compiler.

The last is the one with the best chance of any utility at all. Here is is potentially possible to look at the individual routines, and work out that this particular code is perhaps the printf function, and decode it as such. However there are huge problems. First all variable names will be 'meaningless'. Second, so will the function names. Third even if in some places the original routine can be worked out, there will be places, where there are literally dozens of different possible code arrangements, that could result in that particular assembler.
For the earlier source possibilities it gets even worse.

It is possible to have a program that will generate a set of C code, that will result in a particular assembler output, for some assembler programs (though not all, except as something like a simple 'ROM' declaration - the V4 compiler can do this), but the resulting C, is likely to be harder to modify for any particular purpose, than the original assembler would be...

Best Wishes
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Nov 28, 2006 11:56 am     Reply with quote

Quote:

Are you being sarcastic and implying that it cant be done?


I wasn�t sarcastic as you say, just a joke that you didn�t catch.

Considerable efforts are made by compiler builders to make a good translator
from High Level to Low Level and suddenly a question requesting just the opposite,
that�s all...

I doesn�t know translators from assembly to C code for PIC, there are some as
Ttelmah said, that generate an assembler that has come from a 'known' compiler.

http://citeseer.ist.psu.edu/cifuentes98assembly.html


Humberto
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

PostPosted: Wed Nov 29, 2006 10:08 am     Reply with quote

Hey, Someone....

Do you have an assembly language program you are currently working with? If so, what compiler does it require? I have used both the microchip compiler and the Tech-Tools (8051-like) assembly compiler. Do you have the source assembly code or just the machine language code that was read out of a chip?

It is not too difficult if you understand both assembly and C to convert an assembly language program to C. I had to do it a few months ago. It has to be done manually, line by line.

I hope this helps.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group