4 ms·
>> I think one element of writing ASM by hand is the programmer subliminally changes the algorithm to be 'simpler' to write. I strongly disagree :-) My experi
by wiz21c 7y ago
>> I think one element of writing ASM by hand is the programmer subliminally changes the algorithm to be 'simpler' to write.
I strongly disagree :-)
My experience is that optimizing assembler leads to reorganize your code or even your algorithm into a form that you'll CPU will be most efficient at executing which almost always translate to unbelievably intricate, super hard to modify code. I've done stuff on 6502, 80x86, MMX and the assembly parts, optimized for speed and ended up with impossibly tricky code. Worst, sometimes I have to adapt my data structures to allow optimization, which becomes even tougher. So, I prefer to leave assembly code at the "onyl if necessary" level
But now, to be honest, optimizing assembly code is incredibly satisfying to me :-) I've got the feeling to use a CPU to its maximum capacity. Also, using assembly comes after thorough algorithmic study. So once I'm at the ASM level, I've maxed out my own capabilities ! How happy me !
So if you have the chance to do that, just give it a try !
- arghwhat 7y agoI suspect that this occurs for you exactly because you're aiming for optimization. This can happen in any language, really. I'd assume that when you maintain larger codebases (i.e. full OS and application suite), that you start writing practical and maintainable code instead.
- wiz21c 7y agoahhh I'm biased. Your analysis is right :-) But even so, I'd say that ASM doesn't help. Clumsy code in ASM is worse than clumsy code in high-level language :-)
- fouc 7y agoIf you write assembler in a maintainable way, do you still gain lots of benefits over a compiler?