Discussion
How my application programmer instincts failed when debugging assembler
Kiboneu: Neat. The author is about to stumble onto a secret.> In Sum# > Abstractions. They don’t exist in assembler. Memory is read from registers and the stack and written to registers and the stack.Abstractions do not exist period. They are patterns, but these patterns aren’t isolated from each other. This is how a hacker is born, through deconstructing what an abstraction really is — imaginary.
Chaosvex: Not sure what to take away from this. __abstract works because GCC allows it as an alias to __abstract__, not because parsing the syntax is forgiving.Abstractions do exist (disagreeing with the single other post in here) and they also exist in most flavours of assembly, because assembly itself is still an abstraction for machine code. A very thin one, sure, but assemblers will generally provide a fair amount of syntactic sugar on top, if you want to make use of it.
userbinator: 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.
jiehong: Then you goto hell…
mathisfun123: > Asm is simple enough that "mental execution" is far easier, if more tedious, than in HLLsYa 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"!)
userbinator: 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.