4 ms·
Learning x86 (Intel) assembly is definitely something I've been interested in, as someone who inexplicably enjoys writing C code. But PDFs like this one are all
by sdegutis 10y ago
Learning x86 (Intel) assembly is definitely something I've been interested in, as someone who inexplicably enjoys writing C code. But PDFs like this one are all I can really find, which are a bit daunting and intimidating.
- csl 10y agoThat's rather surpising, coming from someone proficient in C. Perhaps you only need to discover the close connection between C and assembly. The layer between them is really razor thin — by learning a few C idioms (function prologue/epilogue and the stack frames, argument passing, etc.) you'd be well on your way. You also need to start writing simple asm code as soon possible; only reading about it won't make it stick.
- kabdib 10y agoIt's not that bad. I usually start small: - Write a program that just returns, or halts; - Write a program that prints something or blinks an LED; - Print numbers 1-10; - Handle some input, using function calls. - Write some data structure (binary tree or hash table). Or maybe get an MMU working, and handle a system trap. ... working your way up to writing a context switch handler, for a coroutine or threading system, of course :-) ... at that point, you're off to the races. Mostly I try to get the toolchain a debugger working reliably in the first step, and everything just builds on that.
- lsr32 10y agoFor learning purposes I would recommend against using any kind of macro assembler. As tempting as macros are for making subroutines, calling conventions easier it starts to look a lot like verbose pseudo-C and you're better off just writing C at that point.
- justin66 10y agoKip Irvine's assembly language textbook is pretty good, as I recall: http://kipirvine.com/asm/ http://kipirvine.com/asm/ At least one guy in our class used Linux tools to work through the chapters we studied, although the instructions are focused on VS.
- e12e 10y agohttps://github.com/0xAX/asm https://github.com/0xAX/asm was posted a while back on hn - since then it's grown a bit - I've not kept up entirely, but it does start off pretty basic. It's a nice quick read/work-through before you get "serious". [ed: Initial hn discussion should be relevant to this thread: Say hello to x64 Assembly, part 1 (0xax.blogspot.com) https://news.ycombinator.com/item?id=8245581 https://news.ycombinator.com/item?id=8245581 (The posts are posted on the blogspot blog, but if I'm not mistaken they're all there in full, in the github repo) ]