I'm looking for texts that give detailed treatment of assembly programming principles and don't use x86 as the target architecture. I haven't found any recent books like that, but I would expect that there were some good ones written in the 1970s and 1980s, when whole applications were still written in assembly. The architecture used should also be one of the cleaner designs, such as the 6502 or VAX.
Classic assembly language texts not using x86?
1.4k views Asked by wrp AtThere are 11 answers
I would also look at the 6809 and 68000 chip set assembly for "cleaner design" based on what I programmed on back then in assembler.
To go further, I actually found the IBM 360/670 set of assembler to be quite easy to code. Specific texts - look for some old text books for that if you want to get a pretty good grounding in register management etc. I probably have one on a shelf somewhere, will look in the dusty corners when I get a chance.
Not sure why but I did NOT like the Z80 in the old Xerox PC, it was a pain for some reason.
It's not a classic book (was originally published in the 90s), but I learned MIPS asm from Computer Organization and Design: The Hardware/Software Interface by Patterson and Hennessy (ISBN: 0123706068). The book isn't strictly about assembly; it's a computer architecture textbook. But MIPS is a decently clean architecture.
Although I suppose if you're asking for a classic, you're probably looking for something that goes fairly indepth into the works.
Knuths The art of Computer Programming provides examples in MIX or MMIX, a hypothetical assembly language.
The Art of Computer Programming (when it's finished) will be quite thorough!
I think the market for books about 1970s and 1980s processors was tiny, and you would only find manufacturers documentation, if any.
I'm sure most of it ended up as landfill, but maybe some of it was saved by hobbyists.
It might be worth searching for archived material in PDF format, from Motorola, MOS Technology, Digital Equipment Corporation, and so on.
I used this book in school. It was for Motorola 68000.
I also found free ARM Assembly Programming book online.
I doubt it's still in print, but my beginning university CS class in 1977 used the CDC Cyber, one of Seymour Cray's architectures. (Holy Moly! It's on Amazon!) It is a pretty decent assembly language actually. It included a unique feature called micros which was kind of like macros, but more flexible for string trickery such as creating symbols label1
through label999
in about three lines of source.
Actually, at that time, whole applications were uncommonly written in assembly. I knew of a text editor that was, and good portions of the operating system certainly were, but few applications.
Beyond that, I don't recall there being any good assembly language books. But my exposure was limited since the second CS class used the new Motorola 6800—and that was documented by an ad hoc collection of notes. In later years we used C on Unix v6, but there was no requirement to write assembly, and only a few exercises where it was useful to read and understand the PDP-11 assembly language, especially for the kernel reading class, though 98% of the kernel was written in C
.
After all that exposure, I knew enough CPUs and assemblers that rarely did I need more than the manufacturer's processor architecture reference and an assembler—except the iNtel processors. A big challenge was DEC's RSX threaded compiler output language which consisted completely of a series of assembler macros. But most processors were simple to understand and program including the Texas Instruments 9900, Motorola 68000 and 68010, Z80, 6502, VAX 750, and the TMS 16016/32032.
The iNtel family processors were exceptionally hard to grok, both the 8086 and the 8047/8052 family. Highly non-orthogonal and loaded with weird modes: Why can AX
and BX
be directly exchanged, but not DS
and ES
? Especially after the 80386 came out—loading a segment register in protected mode incurred a huge clock cycle penalty. Then there was the weird segment control pseudo instructions, and segment classes, and a code locator—a post processing of object code after linking. Lots of weird, clumsy tools.
A few classic books covering the 6502; complete text online:
Machine Language For Beginners (1983)
The Second Book Of Machine Language (1984)
Assembly Language Programming for the Atari Computers (1984)
Check out popular microcontrollers such as the Atmel AVR series. This is where assembler programming is still a hot topic. There are plenty of books that will teach you how to program such devices, and also prototyping systems that will allow you to build some really cool gadgets.
Atmel AVR microcontrollers have a clean architecture, as do ARM processors. Avoid Microchip PIC devices since they use paged memory. You need a microcontroller with a linear address space.
Chris Torrence has very recently updated Robert Wagner's Assembly Lines with various corrections. It's been a big help to get me started.
Alexander Stepanov, in Lecture 1 of his notes, talks about his conversion to the idea of "structured" assembly programming. Wanting to follow up on this idea, I have searched-out books with titles like "Structured Assembly Programming in Foo". But what I've found has turned out to be coverage of some processor architecture rather than principles of program design. Most of the books mentioned in other answers here are consistent with that.
I have looked at Knuth's AoCP, and it certainly is detailed and does use MMIXAL. But aside from a small bit in v. 1, ch. 1.4, it is about algorithm design, not program design. So it's really in a category with something like Cormen, et. al. "Introduction to Algorithms".
So maybe there just isn't anything like what I was looking for.