编程与软件工程gpfault.net
一起来学 x86-64 汇编
Let's Learn x86-64 Assembly (2020)
2020 — 2025,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是一篇 x86-64 汇编入门教程的第一部分,作者从最小可运行的程序讲起,逐步介绍寄存器、指令和工具链;从评论看,后续内容还涉及 Windows 的 PE 格式和 DLL 导入等话题。全文以纯文本网页形式发布,偏 Windows 视角,结构跨度较大。
为什么经久不衰:汇编和机器层的知识十几年不变,想真正理解 CPU 与程序的执行方式,这类从零手写的教程始终是难以替代的入口。
HN 评论精选
x86 太杂乱不适合入门,建议从 ARM 或写模拟器起步,并质疑教程后半段跑题到 PE 格式。
很多人用 x86(-64) 入门汇编,但这个指令集混乱、复杂又层层叠加,在我看来始终是糟糕的选择——就像用 C++ 上编程入门课,能理解其现实理由,但弊大于利。我更推荐弄块 ARM/ARM64 开发板从它入手,概念大多可以迁移;为某个简单架构写一个 CPU 模拟器再在上面编程也是很好的教学方式。另外这篇教程结构有点怪:从 “int3 ret” 直接跳到“PE 格式与 DLL 导入”,跨度太大,而且未必与学汇编强相关。
simias查看英文原文
It's very common for people to learn assembly using x86(-64) but this ISA is so messy, complicated and layered that it always seems like the bad choice to me. It's like teaching an intro programming course using C++, I understand why it's practical but it seems like it will be more trouble than it's worth. I'd probably recommend getting some ARM or ARM64 board and starting with this, most of the concepts will carry over to other assemblies anyway. Writing a simple CPU emulator for some simple architecture and then coding on it can also be a great teaching experience, if a little more involved. I find this tutorial a bit oddly structured too, but that may be because I'm from un*x world and I don't have the Windows mindset. It basically goes from "int3 ret" to "The PE Format and DLL Imports". That seems like quite the jump, and not necessarily super relevant to learning ASM IMO.
用移植 JonesForth 这种小而完整的项目来练 x86-64,是很有收获的学习方式。
我最近挑战把 JonesForth 移植到 x86-64,这是很久以来最有收获的个人项目之一:我能写 x86-64 而不必先搭一个完整应用,过程中顺带学 Forth 更有趣。我知道已有 jonesforth64,但自己动手移植完全值得。
mlang23查看英文原文
I recently took up the challenge of porting JonesForth to x86-64. It was one of the most rewarding personal challenges in a very long time. For one, I was able to write x86-64 without needing to whip up a complete application. And learning Forth during the process was even more fun. https://github.com/mlang/jonesforth And yes, I know there is also jonesforth64. However, doing the porting myself was totally worth it.
指出原文一处错误:ah/bh/ch/dh 是第 8-15 位,而非“高 8 位”。
> 另外,rax、rbx、rcx、rdx 的高 8 位可以称为 ah、bh、ch、dh。 那是第 8 到第 15 位(最低位为 0、最高位为 63),不是最高的 8 位。没时间读全文,但看起来不错。
beagle3查看英文原文
> Additionally, the higher 8 bits of rax, rbx, rcx and rdx can be referred to as ah, bh, ch and dh. That’s bits 8-15 (lowest being 0 and highest being 63), not the highest 8 bits Didn’t have time to read the whole thing, but it looks nice.
称赞页面深色主题的对比度处理得当、阅读舒适。
完全跑题,但必须说:这是少数把深色背景浅色文字做得好的网页之一。对比度控制得当,文字可读,不用切到阅读模式或戴墨镜。希望那些用惨白字配纯黑底的网站学学。
tempodox查看英文原文
Completely off topic, but I just have to say it: This is one of the few light-text-on-dark-background web pages that actually does it well. Contrast is managed so the text is still readable without escaping to Reader View or wearing sunglasses. I wish those sites that use squeaky-white on pitch-black would take example of this.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选