7 ms·
The Art of Assembly Language Programming (1996)
- shadowofneptune 5y agoA very useful book for MS-DOS programming. MASM is also an excellent assembler, even in early versions. The proc/endp blocks for instance make reading a subroutine much easier. Does anyone know of a similar book for AMD64 assembly language programming?
- ranger207 5y agoThe author (Randall Hyde) just released an x64 assembly book in October: https://nostarch.com/art-64-bit-assembly https://nostarch.com/art-64-bit-assembly
- shadowofneptune 5y agoThanks, this looks great!
- krallja 5y agoWhy does it call the processors the 886, 8286, 8386?
- galangalalgol 5y agoThat is a good question, maybe they had only heard it spoken, so they thought it was 83 86 instead of 8086,80386 etc.
- agumonkey 5y agoIn France, 80386 was often read 80-3-86 (same for 80-2-86). And eigty SPC three === eighty three.
- makapuf 5y agoNever heard of it that way in france with my friends, for me it was always 80-86, 80-88 or just 386 or 286 (or 80-286 if you wanted to sound technical).
- shadowofneptune 5y agoNo, the book introduces these serial numbers as idealized versions of the processors. It allows the reader, who is treated as a beginner to processors, to develop a mental model of them without any complications. The edge cases, pitfalls, and issues of the true processors are revealed over the course of the book. Not sure about the merits of calling the ideal processors by special names.
- djur 5y agoThey're simplified hypothetical variants of the x86 processors, according to one chapter.
- krallja 5y agoAh, I see it in Section 3.3: http://www.phatcode.net/res/223/files/html/Chapter_3/CH03-3.html#HEADING3-1 http://www.phatcode.net/res/223/files/html/Chapter_3/CH03-3....
- bch 5y agoRelated(?) I'm looking for recommendations for a good intro/reference to the intel arch wrt operations and registers, esp wrt Unix conventions (if unix differs from (eg) Windows wrt creating a process or pushing/popping stack...)
- ghaff 5y agoAnother interesting book--at least for historical context--is Michael Abrash's Zen of Assembly Language Programming. A lot of the optimizations are a good read if you're into that sort of thing but there's not a lot of practical interest for today. (Abrash in fact never wrote the Volume 2 he was planning to.)
- pan69 5y agoWhich is also hosted on Phatcode: http://www.phatcode.net/res/224/files/html/index.html http://www.phatcode.net/res/224/files/html/index.html
- canMarsHaveLife 5y agoCan Assembly be considered a programming language? Isn't is just a language for... assembling?
- ghaff 5y agoSure. It's less abstracted than anything except for machine code but that doesn't make it not a language.
- pavlov 5y agoMost assemblers have macros and other directives that give you some level of higher-order control than just writing machine code.
- convolvatron 5y agoassuming you have enough registers, burn a small number of them to support internal use in macros. assign the rest to values of interest. you may end up needing to write an additional layer of macros with their own registers that use the first layer as primitives. now you're essentially programming in basic
- jazzyjackson 5y agoOne might say it is the only programming language, everything else is just macro expansion, converting pseudo-english mnemonics into machine instruction. Snark aside, yes, people program entire operating systems and programs and games in assembly. Famously, Rollercoaster Tycoon was written entirely in assembly.
- shadowofneptune 5y agoThis is true only for the most simple assemblers. In practice, each assembler comes with its own distinct set of features. Microsoft Macro Assembler for example offers: • Records/structs, bitfields • Typed labels/pointers. Intel in particular introduced this feature. • Procedure blocks which allow locally scoped labels within them • The automatic allocation of local variables onto the stack. • if/then blocks, for loop blocks • Memory model directives • Macros, equates, etc. Other assemblers like NASM omit some of these features, as introducing versions of these features which are completely compatible with the MASM ones would be difficult. For example, NASM allows MASM-like procedure blocks, but they are not block-scoped. They're just a notation for the programmer.
- imiric 5y agoWould 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.
- pan69 5y agoThis version of the book is good! Great for beginners and experts alike. However, in later versions of this book (one of which I have on my bookshelf), the author uses High Level Assembler (HLA) which is according to the back cover of the book; "a revolutionary tool...". It is basically a proprietary compiler that uses a syntax that is "interesting" but not portable to the rest of the world of x86 assembler. So, if you buy the book (like I did), please be aware of this.
- userbinator 5y agoI agree. HLA syntax can best be described as "if someone who knows only C decided to make an Asm syntax". I remember much flamewars on newsgroups about it. GNU GAS syntax is roughly as repugnant, but became popular only because of GNU/Linux. Deviating from the official docs has caused much divisiveness and confusion.
- msla 5y ago> GNU GAS syntax is roughly as repugnant, but became popular only because of GNU/Linux. AT&T syntax predates GNU and x86, and spread just fine without Linux.
- edgyquant 5y agoGas uses AT&T syntax but I believe that poster is referring to how they borrow certain things from C (and the preprocessor.)
- pjmlp 5y agoTI used to have an Assembly for a DSP that was like C written in SSA form. No idea how it was called. Fully agree with GAS syntax being a pain.
- mananaysiempre 5y agoAre you sure it was TI? The Blackfin DSPs made by Analog Devices are known for using an infix assembly syntax in the official documentation, although it might be a stretch to tie it to C specifically.
- vbezhenar 5y agoI'm reading RP2040 Assembly Language Programming book right now. It's very interesting introduction to the assembly language. And using assembly for microcontrollers seems very fitting to me, at least for hobbyist level.
- repiret 5y agoAs microcontrollers go, Cortex-M is especially pleasant to program in C.
- phendrenad2 5y agoWhat's a good modern book for modern assembly languges?
- justin66 5y agohttps://asmirvine.com/ https://asmirvine.com/
- djmips 5y agoPeople interested in this might also enjoy 'Inner Loops' (1997), an excellent book that covers optimizing x86 at that time but is instructive in general and the concepts are still applicable today. https://www.amazon.com/Inner-Loops-Sourcebook-Software-Development/dp/0201479605 https://www.amazon.com/Inner-Loops-Sourcebook-Software-Devel...