some tool to convert C code to x86
I was wondering if there is any program/tool which can convert C code into the corresponding x86 code for me?? I dont know if gcc does this...I have never written C code in unix (or in ne other OS for that matter) and hence am very new to this.
Please let me know if u know some. |
moving to programming
|
"gcc -S -o test.S test.c" will create a file test.S that contains the assembly version of test.c. If you are using either an gcc-x86 cross compiler or are on an x86 compiling natively these assembly instructions will be x86 assembly.
I think this is what your asking for... if not, let us know. |
Quote:
|
If I may, can i also ask if there is any way to convert perl code into assembly?? I am basically trying to get spamassasin code in assembly. I thought i could use perlcc to convert from perl to C and then the gcc command to convert to assembly but it seems like perlcc does not work on any of the perl files in the spamassasin code base.
thanks |
That is more tricky.
Perl is interpreted, not compiled. So there is no assembly version of it (at least strictly speaking). At best, you will get assembly listing of your code interpreted by the perl engine. So the assembly will be a mixture of your code and of the perl engine code. Why do you want to have the assembly? I mean, perl can run on an x86, so you can run spamassassin on that platform. Its the point of writing a program in a language like perl. |
Quote:
|
Ouch! That is going to be some assignement!!
If you were assigned Spamassassin by the teacher, you should check with him if he is aware that spamassassin is in perl. In other words in an interpreted language. Because to do what you are talking about, you will need to actually optimize both Spanassassin AND the perl framework! If you still need to do it, I would say the best way is to try to make perlcc work with your code. Then fallow your original idea. The other way to go would be to run Spamassassin in a debugger, and make a memory dump of the code. I used something like that once, but I dont remember the name of the software. BUT be warned that you will get the instructions of SpammAssassin, the Perl framework AND the instructions of the librairy and kernel calls being made! This is going to be even bigger. I doubt your assignement is to optimize the way the recv() fonction for the sockets works. Good luck |
All times are GMT -5. The time now is 04:49 PM. |