Remix.run Logo
userbinator 8 hours ago

Asm is simple enough that "mental execution" is far easier, if more tedious, than in HLLs, especially those with lots of hidden side-effects. The concept of a function doesn't really exist (and this is even more true when working with RISCs that don't have implicit stack management instructions), and although there are instructions that make it more convenient to do HLL-style call and return, it's just as easy to write a "function" that returns to its caller's caller (or further), switches to a different task or thread, etc. If you're going to learn Asm, then IMHO you should try to exploit this freedom in control flow and leverage the rest of the machine's ability, since merely being a human compiler is not particularly enlightening nor useful.

streetfighter64 6 hours ago | parent | next [-]

I agree entirely, great insight! I'd like to add that assembly is best enjoyed in a suitable environment for it, where "APIs" are just memory writes and interrupts. Game programming for the C64 is way more fun than dealing with linux syscalls, for example. A lower level interface enables all the fun assembler tricks, and limited resources require you to be clever.

mathisfun123 8 hours ago | parent | prev | next [-]

> Asm is simple enough that "mental execution" is far easier, if more tedious, than in HLLs

Ya totally I can also keep 32 registers, a memory file, and stack pointer all in my head at once ...fellow human... (In 2026 I might actually be an LLM in which I really can keep all that context in my "head"!)

RobotToaster 7 hours ago | parent | next [-]

there's an interesting new API skill for the human cortex v1.0, that allows for a much larger context window, it's called pen and paper.

ExtremisAndy 4 hours ago | parent | next [-]

For real! I occasionally write assembly because, for some reason, I kind of enjoy it, and also to keep my brain sharp. But yes, there is no way I could do it without pencil and paper (unless I’m on a site like CPUlator that visually shows everything that’s happening).

mathisfun123 27 minutes ago | parent | prev [-]

What do the words "mental execution" mean?

userbinator 8 hours ago | parent | prev [-]

8 registers are sufficient; if you forget what one holds, looking up at the previous write to it is enough.

Contrast this with trying to figure out all the nested implicit actions that a single line of some HLL like C++ will do.

jiehong 8 hours ago | parent | prev [-]

Then you goto hell…