cxcodeassemblyxcode4

Looking at the assembly code of a C file using the Xcode option Generate Output>Assembly


So I'm trying to study the assembly code of a simple C program using the "Product> Generate Output> Assembly File" option in Xcode 4.5. No matter how I try to trigger it, the option is still greyed out. Any advice for what's necessary to generate the assembly file?

Even this simple loop statement isn't giving me the option:

int main (int argc, char **argv)
{
    int     x = 3;
    int     y = 4;
    int     z;

    z = x + y;

    return 0;
}

Other posts have gone to lengths to talk about the convenience of this option, any help would be appreciated.


Solution

  • Make certain your "main.m" file is selected (highlighted) in the list of files on the left side of your project window. Then Xcode will know that this is the file you want to generate output on and the Generate Output -> Assembly option will be enabled.