Assembly Nights (2021)
Posted by andsoitis 3 days ago
Comments
Comment by nickledave 16 hours ago
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
Comment by WalterGR 1 day ago
Comment by 1vuio0pswjnm7 13 hours ago
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)
Comment by nickledave 17 hours ago
Comment by SenHeng 18 hours ago
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.
Comment by hn_submit 1 day ago
To me all assemblers look alike and it would even be feasible to write one's own just for the heck of it.
Comment by anonymous908213 1 day ago
Comment by hn_submit 18 hours ago
Comment by anonymous908213 17 hours ago
Comment by userbinator 1 day ago
Comment by gopalv 1 day ago
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.
Comment by stevekemp 17 hours ago
Comment by pjmlp 15 hours ago
Alone the mental exercise to always convert into official documents and AT&T syntax isn't worth the trouble.
Comment by halb 16 hours ago
The screenshots of this popular gdb plugin are a good example: pwndbg.re/stable/features
Comment by pjmlp 21 hours ago
Comment by gregkb 16 hours ago
Comment by stevekemp 17 hours ago
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.
Comment by nekiwo 1 day ago
Comment by hn_submit 1 day ago
Comment by momocowcow 20 hours ago
Yet GDB lives on
Comment by cellsstudio 1 day ago
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...
Comment by userbinator 1 day ago
Comment by ZeroDayDreamer 18 hours ago