Compiler Explorer is very handy for this kind of work.koitsu wrote:You can use gcc -S -masm=intel to review the generated assembly (.s files) in Intel format. Rest of my advice about optimisation flags etc. from and earlier post still applies. Don't be surprised if what you find scares you.
Programming in C - questions
Moderator: Moderators
Re: Programming in C - questions
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: Programming in C - questions
One word - awesome.thefox wrote:Compiler Explorer is very handy for this kind of work.koitsu wrote:You can use gcc -S -masm=intel to review the generated assembly (.s files) in Intel format. Rest of my advice about optimisation flags etc. from and earlier post still applies. Don't be surprised if what you find scares you.
I'm playing with it and... my CHR decoding function was 85 ASM lines. Now it's 67.
Re: Programming in C - questions
godbolt is such a great tool.
I dunno. Initializer lists seem like a clear winner to me. They require no analysis to optimize; they produce better code than memset on -O0. And their syntax is... well... intended for initialization!However, if the performance of an initializer is critical for your application there is no general advice anyone can give for how to write it the "best" way.
If you understand 'if' 'for' 'while' and functions then start writing code. That's all you need to get started.Anyway, does anyone know of any good recourses for learning C from Java?