经典汇编语言文本不使用 x86?
我正在寻找详细介绍汇编编程原理并且不使用 x86 作为目标体系结构的文本。我还没有找到任何类似的近期书籍,但我希望在 20 世纪 70 年代和 1980 年代有一些好书,当时整个应用程序仍然是用汇编语言编写的。使用的架构也应该是更简洁的设计之一,例如 6502 或 VAX。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
几本涵盖6502的经典书籍;在线完整文本:
初学者机器语言 (1983)
Machine Language For Beginners (1983) atariarchives.org/2bml/" rel="noreferrer">机器语言第二本书 (1984)
Atari 计算机的汇编语言编程 (1984)
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)
这不是一本经典书籍(最初出版于 90 年代),但我从 Patterson 和 Hennessy 的《计算机组织与设计:硬件/软件接口》(ISBN:0123706068)中学习了 MIPS asm。这本书并不是严格意义上的组装;而是关于组装。这是一本计算机体系结构教科书。但 MIPS 是一个相当干净的架构。
虽然我想如果你想要一部经典,你可能会寻找一些对作品相当深入的东西。
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.
高德纳 计算机编程的艺术 在 MIX 中提供示例 或 MMIX,一种假设的汇编语言。
计算机编程的艺术(当它完成时)将会非常彻底!
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!
我还会根据我当时在汇编器中编程的内容来查看 6809 和 68000 芯片组组件的“更简洁的设计”。
更进一步,我实际上发现 IBM 360/670 汇编器集非常容易编码。具体的文本 - 如果你想在寄存器管理等方面获得很好的基础,请寻找一些旧的教科书。我可能在某个地方的书架上有一本,当我有机会时会在布满灰尘的角落里查找。
不知道为什么,但我不喜欢旧施乐 PC 上的 Z80,由于某种原因,它很痛苦。
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.
我在学校使用过这本书。它适用于 Motorola 68000。
我还在网上找到了免费的 ARM 汇编编程 书籍。
I used this book in school. It was for Motorola 68000.
I also found free ARM Assembly Programming book online.
我怀疑它是否仍在印刷,但我在 1977 年开始的大学计算机科学课程使用了 CDC Cyber,西摩·克雷 (Seymour Cray) 的建筑之一。 (天哪!它在亚马逊上!)这是一种相当不错的汇编语言实际上。它包含一个名为 micros 的独特功能,它有点像宏,但对于字符串欺骗更灵活,例如创建符号
label1
到label999
大约三行源。实际上,当时整个应用程序通常不是用汇编语言编写的。我知道有一个文本编辑器,操作系统的大部分内容当然也有,但应用程序很少。
除此之外,我不记得有任何好的汇编语言书籍。但我的接触面有限,因为第二个 CS 课程使用了新的 Motorola 6800,并且这是由临时笔记集记录的。后来我们在 Unix v6 上使用 C,但没有要求编写汇编语言,只有少数练习有助于阅读和理解 PDP-11 汇编语言,特别是对于内核阅读课,尽管 98%内核是用
C
编写的。经过所有这些接触之后,我对 CPU 和汇编器有了足够的了解,除了 iNtel 处理器之外,我几乎不需要更多的东西,除了制造商的处理器架构参考和汇编器。一个巨大的挑战是 DEC 的 RSX 线程编译器输出语言,它完全由一系列汇编器宏组成。但大多数处理器都很容易理解和编程,包括 Texas Instruments 9900、Motorola 68000 和 68010、Z80、6502、VAX 750 和 TMS 16016/32032。
iNtel 系列处理器(8086 和 8047/8052 系列)都非常难以理解。高度非正交且充满奇怪的模式:为什么
AX
和BX
可以直接交换,而DS
和ES?特别是在 80386 出现之后,在保护模式下加载段寄存器会导致巨大的时钟周期损失。然后是奇怪的段控制伪指令、段类和代码定位器——链接后目标代码的后处理。很多奇怪、笨拙的工具。
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
throughlabel999
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
andBX
be directly exchanged, but notDS
andES
? 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.查看流行的微控制器,例如 Atmel AVR 系列。这就是汇编程序编程仍然是热门话题的地方。有很多 书籍将教您如何对此类设备进行编程,以及原型制作系统这将使您能够构建一些非常酷的小工具。
Atmel AVR 微控制器与 ARM 处理器一样具有简洁的架构。避免使用 Microchip PIC 器件,因为它们使用分页存储器。您需要一个具有线性地址空间的微控制器。
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.
TI msp430是一个非常好的架构,让我第一次看到它时想起了pdp11。至于书籍,我不知道我开始写一本但从未完成......无论如何可能不是您正在寻找的那种。
The TI msp430 is a very nice architecture, reminded me of the pdp11 the first time I saw it. As far as books, I dont know I started to write one but never finished...Probably not the kind you were looking for anyway.
我认为有关 1970 年代和 1980 年代处理器的书籍市场很小,而且您只能找到制造商文档(如果有的话)。
我确信其中大部分最终都被填埋了,但也许其中一些被业余爱好者保存了。
可能值得搜索来自 Motorola、MOS Technology、Digital Equipment Corporation 等的 PDF 格式的存档材料。
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.
Alexander Stepanov 在他的笔记的第一讲中,谈到了他对“结构化”理念的转变。 “汇编编程。为了跟进这个想法,我搜索了诸如“Foo 中的结构化汇编编程”之类的书籍。但我发现的是一些处理器架构的覆盖,而不是程序设计的原理。这里其他答案提到的大部分书籍都与此一致。
我看过 Knuth 的 AoCP,它确实很详细并且确实使用了 MMIXAL。但除了第 1 节、第 1 章中的一小部分之外。 1.4、是算法设计,不是程序设计。所以它确实属于像 Cormen 等这样的类别。等人。 “算法导论”。
所以也许根本没有像我正在寻找的东西。
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.
Chris Torrence 最近更新了 Robert Wagner 的装配线,进行了各种更正。这对我入门有很大帮助。
Chris Torrence has very recently updated Robert Wagner's Assembly Lines with various corrections. It's been a big help to get me started.