I was wondering if there’s some special way to compile high-level code (preferably from c/c++ or java) to get the corresponding assembly code.
I was wondering if there’s some special way to compile high-level code (preferably from
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
gcc can dump an assembly listing using -S switch – it will emit the assembly code to a file with a .s extension. For example, the following command:
will leave the generated assembly code on the file foo.s.
If you want to see the C code together with the assembly it was converted to, use a command line like this:
which will output the combined C/assembly listing to the file foo.lst.
Most compilers will support something similar to aid debugging the compiler itself. For Visual C++, see this guide.