5 ms·
Would this still be relevant/approachable for a beginner coming from higher level languages, or is there a more modern resource for learning assembly that would
by imiric 5y ago
Would this still be relevant/approachable for a beginner coming from higher level languages, or is there a more modern resource for learning assembly that would be better suited?
I guess most of it is still relevant, but I'd rather not deal with DOS to follow along, and would prefer working on Linux.
Also, the x86 instruction set seems daunting to pick up for a beginner. Would it be better learning on a 4/8-bit or toy machine first?
- Gene_Parmesan 5y agoI found the book "Programming From the Ground Up" to be a pretty good intro to programming in x86, and importantly, more recent than this text. I had to do just a tiny bit of research to find out how to get my shell to emulate 32 bit mode, since it's x86 and not x86-64, but it is in fact Linux based. I imagine it'd be an order of magnitude easier than trying to figure out a DOS setup. The full x86 ISA is daunting, I'm sure, but for a beginner looking to get a sense of what asm is, you don't engage with the entirety of the ISA. The PFTGU text is great specifically because it assumes an audience of beginners who want to learn the basics of how asm operates to enable core programming concepts. It's not aiming to be exhaustive like the linked text. Edit: And also importantly, it's also (legitimately) available for free online.
- Shosty123 5y agoThere's a new version of that book. Same author: https://link.springer.com/book/10.1007/978-1-4842-7437-8 https://link.springer.com/book/10.1007/978-1-4842-7437-8
- pedrolins 5y agoI’m not an assembly programmer, but I’ve learned assembly as part of introductory CS courses (computer architecture classes) and the approachable alternative you’re looking for is the assembly language of a RISC architecture such as ARM, MIPS, or RISC-V. I’d recommend learning the latter because of how approachable it is.
- userbinator 5y agoIf you want to start small, Z80 might be a good point, but it seems opposed to your not wanting to start with DOS; a small VM will be very useful, and with Asm you'll soon discover that even 64k is plenty to play with.
- xupybd 5y agoThe 8051 microcontroller is pretty easy to learn. I'd recommend that as a starter on assembly. But if you want to end up playing with x86 why not start there.
- msla 5y ago> Also, the x86 instruction set seems daunting to pick up for a beginner. Would it be better learning on a 4/8-bit or toy machine first? The x86 instruction set isn't daunting, the 16-bit x86 memory model is, speaking as someone who learned x86 assembly at a young age. It is easier to work on Linux, because segmentation is a non-issue and you have a flat address space.
- userbinator 5y agoSegmentation is also a non-issue if you stay within a single segment. Especially if you're writing in Asm and just starting out, even 64k is a lot. A "hello world" has less than a dozen bytes of executable code. The majority of the standard commands in DOS are <64k binaries.
- spc476 5y agoIt's also not much of an issue if you split code and data, each being 64K in size.
- shadowofneptune 5y agoIs segmentation really that bad? With an assembler you have direct control of which segment is being used. It's unlikely a hobby project will span more than 64k. Even if it does, for a lot of projects the individual data structures are small enough to split between segments.
- spc476 5y agoIt only becomes an issue of have a data structure that can exceed 64K in size, or multiple structures, who aggregate size is greater than 64k in size. Then you have to deal with so called FAR pointers.
- spc476 5y agoTo get a feel for assembly, then yes, any 8-bit CPU would be a good choice. The 8080, Z80, 6502 or 6809. There are plenty of emulated machines today, tons of material are available online, and even cross assemblers that run on modern machines to make development easier. The base concepts will carry over. The x86 instruction set is daunting and it can appear quite arbitrary unless one knows the near 50 years of historical baggage it carries along with it. But I think if you have some experience with an 8-bit CPU, plus just kind of accept the weirdness of it, it's not that bad (especially the 64-bit stuff, which in a way, is simpler, even if half the registers are named, and half are numbered).