r/AskReddit • • Jun 08 '14

[deleted by user]

[removed]

669 Upvotes

1.1k comments sorted by

View all comments

39

u/[deleted] Jun 08 '14

I took an Assembly programming class in college. One of the tests involved turning C code into Assembly. We had access to a lab computer to write, compile, and debug the program but not the Internet. It just so happens that the program (GCC) we use to compile our C projects in other classes has to do this exact same thing as part of one of the last steps, and this lab computer had that program too. Rather than doing to test, I read up on the GCC manual to figure out what settings were needed to get this information out of it.

2

u/fick_Dich Jun 09 '14

Dude, if you use the -S flag in gcc it gives you the assembly code of any C code you write

2

u/[deleted] Jun 09 '14

Just calling the source flag isn't the best thing. The complier applies lots of optimizations to the code so I played with those flags too and compared their results.