Search code examples
macosgccassemblygnu-assembler

Compile Assembly OSX (10.6.8)


I've decided to learn some assembly, however I haven't been able to figure out how to actually assemble it. I'm running OSX 10.6.8 with developer tools installed. I'm running Xcode 3.13, there's no downloads tab in the preferences in the version that I see and the download for command line tools from Apple's site doesn't run on anything less than 10.7.

I've seen some online sources saying that I should use the "as" "gas" or "gcc" commands, however terminal tells me that none of those commands exist. (to test, I simply opened a new terminal window and entered the command name with no parameters. I assume that would work but I could be mistaken.) I can't find any concrete documentation about whether or not this stuff is installed with developer tools/how to check if it is installed/where to install it.

Asking this question here was my last resort, however I'm sure the information was already out there and I just couldn't find it so if anyone could:

  • Explain why these commands don't work/what I should install if I want to assemble some basic assembly
  • Tell me how I could have figured this out on my own

I'd be really grateful. Thanks in advance.

[EDIT]There is a file named "as" in the Developer/usr/bin/ folder so I'm not sure why the command is not found. Do I have to do more than just navigate to the directory of the file I'm assembling and type "as filename"?


Solution

  • You wanted to check "UNIX development" when you installed Xcode. (How were you supposed to know this at the time?)

    You can re-install Xcode, making sure to check that magic box.

    However, the command-line drivers are actually present, they're just not in your path (they're in /Developer/usr/bin, if I remember right, though it's been a long time since I've tinkered around with Xcode 3.x). So you should be able to add that to $PATH and use them.

    As a third alternative, you can always download a distribution of either gcc or clang.