Posted by Danny M2Z on 07/02/2020 06:35:33:
Posted by Neil Wyatt on 06/02/2020 21:04:06:
I haven't done AVR (the chips in Arduinos) for a while. I used to program them in assembler which annoyed most AVR users who love using C, but I just enjoy assembler – it's like solving crosswords.
Neil
Neil, you are a bloke after my own heart.
Writing Assembly Language code, even for a lowly Z80 or 6502 processor is like a crossword puzzle, but when it all comes together how sweet is the feeling?
I used to belong to a PC geek club in Melbourne and the member's used to push each other with a monthly challenge. It was most educational.
…
* Danny M *
Nothing like an example to show why Neil and Danny enjoy pain.
This 'C' program outputs: abcdefghijklmnopqrstuvwxyz

Neil and Danny prefer to write:

To be fair, the Assembler instructions are for a modern Intel processor and these are unfriendly compared with the good old 8080, Zilog's souped up Z80, or the 6502. One reason is modern CPUs are much more complicated than early microprocessors, another is chip designers develop instructions to suit compilers rather than humans because 99% of programs are developed with interpreters, compilers and generators, not by people writing low-level code.
G-code is similar: although it can be read and written by humans, it's really meant to be generated by a CAD/CAM tool and read by a CNC machine.
Used to be quite easy for humans to write better code than a compiler, nowadays the opposite is more likely. 70 years of development have made compiler optimisations very clever indeed. As it needs an exceptionally good programmer to beat an ordinary compiler and she takes forever to do it, writing assembly is reserved for special occasions, one of which is doing it for fun. Otherwise, don't bother!
Dave
Dave