My understanding was processors in the same family.( x86 for example)
.
What I have done a lot of times is the following.
I wrote a program in Tubo Pascal (I like it because the compiler strips out unused library code).
Compile the program to EXE or COM file.
then I use a decompiler to convert it into assembler code and the code is piped to a text file.
Debug (still available in XP) can be used.
You then view the file and copy whatever you need.
Thinking about it you seem to want to have assembler code suitable for x86 and for example a PIC. That would be mostly impossible because the use a different approach. The PIC uses RISC code.
What possessors do you use?
What is your application?
In a lot of cases C compilers are available and it is even possible to create your own compiler.
__________________
Never do today what you can put of until tomorrow - Student motto
C language source code is not executable for processors so your C compiler translates it to a sequence of machine instruction according to the instruction set of the processor. If you load it with the good old "DEBUG" program you can list the executable program with assembly mnemonics.
Moving from a different style of processor to another is always fraught as although the core program will most probably work, all the input and output tasks probably won't! Even within the same family there are differences and these can be very difficult to identify and fix. Even going "up" a proccessor type (newer) means that the code will not be using all the better points of the new processor!!
The suggestion to go to an executable and then back into the language of the next processor is quite a good idea (I have personally never done it though!) as long as you can redo all the I/O as I mentioned before!! This could be quite a daunting task!!!
__________________
"What others say about you reveals more about them, than it does you." Anon.
Once this question was posted at forum, i thought we were asked about some universal program for conversion c to assemble suitable for any processor. So my answ was - no. But after Hendrik reply I`ve seen absolutely new (at least for me) approach. All genius is simple! But who can explain me needs to do such complex conversions. It looks workable for the same platform. But why do we need having working good no matter pascal or c code to assemble one for the same platform? For further optimization?
For another platform we could be find and use cross-assembler. But this case I doubt that it (cross-assembled code) will be work smoothly.
For transfering to another platform source c code it would be more suitable to find appropriate compiler. So often existing compilers have embedded options to create code for several platforms.
i write c code on my x386 machine, compile and get it running the way I want it (usually involving some sort of data link I/O). Then I take the program in text form and load it into another machine with it's own compiler (i.e., my Palm Tungsten E2). First attempt to run it, of course, gives me all sorts of errors, but it is relatively easy to identify the problem lines and rewrite these with the appropriate key words. Not elegant, but it works (I also generally write very small, task specific programs as the need arises- I don't know how effective my approach would be if I tried to incorporate all the eye candy that seems so important to programmers today). Mostly, I am trying to get information in to the computer for further analysis. I am not a computer wiss, either, and I would really like to find someone else to do the tedious work of programming, but I haven't found any commercial software that can solve my problems as quickly as I can by writing my own code.
You don't need to convert C to assembly. You need a C complier for the processor you want the program to run at. There are probably C compliers for all available processors.
I have seen it somewhere but I can't find it now. - You seem to have a PIC with a built in C compiler and you want to use the same code on other CPU's. Is it a compiler or an interpreter?
I last did PIC about 10 years ago (a bit rusty) without any fancy stuff,
There are C compilers (on x86 machines) available and you can set the output for a lot of PIC's. Enquire at the supplier. Microchip supply MPLAB as freeware (Assembler ide) and sells C compilers for the PIC.
Other people also sell C, Pascal and Basic compilers. look on the web there are bound to be free one out there.
I am a DEY (do everything myself) fanatic and would create my own compiler.
Please give some examples of the C code you need to port.
__________________
Never do today what you can put of until tomorrow - Student motto