by klelatti on 4/10/25, 3:02 PM with 15 comments
by raphlinus on 4/13/25, 3:50 AM
Some of the most fun I've had programming assembly has been writing HDMI video scanout kernels for a RP2040 chip[1]. It was a delightful puzzle how to make every single cycle count. It is a great sense of satisfaction of using every one of the 8 "low" registers (the other 8 "high" registers generally take one more cycle to move into a low register, but there are exceptions such as add and compare where they can be free; thus you almost always use a high register for the loop termination comparison). Most satisfying, you can cycle-count and predict the performance very accurately, which is not at all true on modern 64 bit processors. These video kernels could not be written in Rust or C with anywhere near the same performance. Also, in general, Rust compiles to pretty verbose code, which matters a lot when you have limited memory.
Ironically, the reasons for this project being on hold also point to the downside of assembler: since then, the RP2350 chip has come out, and huge parts of the project would need to be rewritten (though it would be much, much more capable than the first version).
[1]: https://github.com/DusterTheFirst/pico-dvi-rs/blob/main/src/...
by musicale on 4/12/25, 10:43 PM
by bee_rider on 4/13/25, 12:23 AM
by microtherion on 4/13/25, 10:41 AM
* Intel 8051, dating from 1980. You can still buy e.g. the CH559, based on the same architecture with an USB interface retrofitted somehow.
* AVR 8-bit architecture. Readily available in (older) Arduinos or easy to handle chip packages.
For modern architectures, reading skills can be very valuable, as they allow you to chase bugs beyond the high level language border. Astonishes your friends & confounds your enemies. Writing is decidedly more niche.
by jjmarr on 4/13/25, 1:56 AM
by DeathArrow on 4/13/25, 8:53 AM
by anta40 on 4/13/25, 4:12 AM
Many years ago: x86 for reverse engineering. Nowadays: bootable games (https://github.com/nanochess is an excellent treasure trove) and classic game consoles (GBA, SNES) etc.
by hdrz on 4/13/25, 11:43 AM