@fabianfnas saidMy but code was elegant in the days when we had only a few KB of RAM.
The first computer I had, a Nascom, buildt around a Z80, didn't have space for an assembler. I coded everything directly in machine code.
One of my programs were a MasterMind game. Both CodeMaker side and CodeBreaker.
Later, on a PC, I wrote a crossword generator in Assembler, for Intel 8086 processor.
Those were the days... (Sigh)
@bigdoggproblem saidI haven't written an entire function in assembly in years, although the gnu one does allow comments. These days I'll very occasionally need access to specific machine instructions, for example rdtsc to get timing information.
Right...unless you made a separate document, there was no comments possible.
I remember learning assembly language. Fortunately, by that time, there was C for writing actual programs. The only assembly language programs I ever wrote were academic assignments.
It was useful for understanding what higher level languages actually do, at least.
The time it's most likely to be important is for highly optimized code you sometimes need to look at the compiler's output. Intel processors read instructions 16 bytes at a time and if the inner loop fits into one of these blocks it'll run about 30% faster. One time I had to optimise a function where the API specified the lengths of the inputs with 64 bit integers. Looking at the compiler output using objdump, which tells you the instruction length, I noticed that because the loop counter was 64 bit a rex prefix was causing the inner loop to be 17 bytes long. So I just changed the type of the loop counter and added some defences against stupidly large buffers and that produced the required speed up.