ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi,
few days ago i've found some old programs whitch i wrote when i was starting programing in c, now i want to look into them, but i don't have sources. i disasembeled them and now i have some sources in asm.
unfortunetly i don't know asembler so i have a question, is there any posibility to translate thos sources in asembler into c or c ++ source file?
The problem is that the original compiler took your code and converted it into machine code (I hesitate to use the term 'assembler'), and it quite likely optimised it. If it saw that you had a for loop for example, and that the variable (lets call it 'i') was only used inside the loop, it might not bother with 'real storage' for i, but use a register. So long as the program works, you don't care.
To work backwards, what you would really need to do is to write some sample code and then see what code gets generated. If you have a variable called c and you write c++;, what code will get generated. With some study, you will get to regognise the pattern that represents the use of the ++ operator - and the same goes for everything else.
Of course, unless your program was compiled with all the debug information, you will not have any variable names, so you have to guess at what is going on.
I have decompiled programs in the past (when computers had fewer, more powerful commands - which made it easier) and you have to step through to get the feel for what the code is doing.
<JOKE> Someone once told me that C is a write only language. You write your program, and if it doesn't work, you tear it up and trry again, because no-one can read a C program.</JOKE> Seriously, unless your program holds the secret of life, tear it up and start again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.