As for going further staying with the bare-bones approach, I suppose you'd have to start looking at assembly output and how that fits with what the c-code does. I don't know anything about OSX x86_64 calling conventions etc -- but at least under Linux (and afaik windows) 64bits is a lot more friendly and fun than the mess that was 32bit (and 16bit) x86.
There are a couple of great (free) resources on 32bit x86 assembly I'm aware of:
There's apparently some plans on upgrading HLA to x86_64 -- I don't know of any good tutorials or guides on working on 64bit assembly specifically I'm afraid.
Just adding "-S" and looking at the source can be helpful of course, although I much prefer nasm/intel syntax, for clang/gcc that should require:
Note that gas syntax is the "default" in the gnu-world, so it might be easier to just go with that if you're just starting out.
It looks like clang might be generating less "noise" for tiny trivial
programs, here's a side by-side-diff (in intel syntax) of int main{} vs
int main { return 0;} (slightly reformatted):
There are a couple of great (free) resources on 32bit x86 assembly I'm aware of:
http://www.drpaulcarter.com/pcasm/ http://www.plantation-productions.com/Webster/HighLevelAsm/i...
There's apparently some plans on upgrading HLA to x86_64 -- I don't know of any good tutorials or guides on working on 64bit assembly specifically I'm afraid.
Just adding "-S" and looking at the source can be helpful of course, although I much prefer nasm/intel syntax, for clang/gcc that should require:
Note that gas syntax is the "default" in the gnu-world, so it might be easier to just go with that if you're just starting out.It looks like clang might be generating less "noise" for tiny trivial programs, here's a side by-side-diff (in intel syntax) of int main{} vs int main { return 0;} (slightly reformatted):
It can be fun to do this with stuff like hello world (and contrast puts("Hello, world!"); with printf("Hello world!\n);).