Assembly Nights (2021)
ratfactor.com
ratfactor.com
And the final implementation: https://ratfactor.com/repos/nasmjf/
Here's the Programming from the Ground Up book the author references at the end of the post: https://programminggroundup.blogspot.com/2007/01/programming... https://download.savannah.gnu.org/releases/pgubook/
And the source for asmtutor, which appears to be down: https://github.com/DGivney/assemblytutorials
I'm very interested in this rabbithole, see the similar origin story for uxn: https://100r.co/site/weathering_software_winter.html
The author claims Intel syntax is ubiquitous. True. But so is "historical" UNIX
Long rants about asm syntax are old, tired tropes. Perhaps they are entertaining to beginning programmers but today such rants achieve nothing except to put the sanity (and hence the judgment) of their authors into question
The existing ATT syntax assembler in "historical" UNIX source trees will not be translated it into Intel syntax
By all means, _use_ Intel syntax^1
But if "historical" UNIX is one's focus, comfort with _reading and editing_ ATT syntax, despite all of its alleged flaws, will continue to be useful
1. The author's own footnote:
"You can tell GCC to use Intel syntax for its inline assembly with -masm=intel. This doesn't work with Clang; complain to them. (Or just don't use inline assembly; it's usually not a great idea anyway.) For objdump, pass -Mintel. And for gdb, put set disassembly-flavor intel in your ~/.gdbinit."
Perhaps some HN readers might like this:
https://raw.githubusercontent.com/pirate/assembly-repl/main/...
https://github.com/pirate/assembly-repl
(requires clang)
I don’t understand how people do this without wrecking their sleep. I’m studying to be a CPA and that little One More Thing just before bed time totally wrecks my sleep. Studying (even something as boring as tax laws) gets my mind excited and I’ll be up till 6am no matter how physically/mentally tired I am.
To me all assemblers look alike and it would even be feasible to write one's own just for the heck of it.
I would automatically type
(gdb) x/4i $pc
when opening a coredump out of habit.
But using nasm, then looking as gas style assembly in the debugger might be a bit more jarring.
Alone the mental exercise to always convert into official documents and AT&T syntax isn't worth the trouble.
Yet GDB lives on
Mostly all I do is run a backtrace from the segfaults, and otherwise single-step through the code to verify my assumptions.
GDB has sufficed pretty well, though I admit I spent a long time writing the stop© garbage collector, and tracing through it trying to understand why I was getting segfaults.
I'm sure there are better tools, but for simple debugging it was sufficient.
The screenshots of this popular gdb plugin are a good example: pwndbg.re/stable/features
I feel like this is a great way to get back to basics and keep the eng skills sharp. Maybe I should try something similar...