<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Assembly on Tony Bai</title><link>https://tonybai.com/tags/assembly/</link><description>Recent content in Assembly on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Thu, 28 May 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/assembly/index.xml" rel="self" type="application/rss+xml"/><item><title>省下 10% CPU！Uber 揭秘 Go 栈扩容的隐秘代价</title><link>https://tonybai.com/2026/05/28/uber-reveals-hidden-cost-of-go-stack-growth-10-percent-cpu-savings/</link><pubDate>Thu, 28 May 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/05/28/uber-reveals-hidden-cost-of-go-stack-growth-10-percent-cpu-savings/</guid><description>本文永久链接 – https://tonybai.com/2026/05/28/uber-reveals-hidden-cost-of-go-stack-growth-10-percent-cpu-savings 大家好，我是Tony Bai。 在顶级互联网巨头的底层架构中，性能优化绝不仅仅是写两段优雅的代码，而是一场“刀尖舔血”的硬核战争。 试想一下，如果你的公司拥有超过 **200 万个 CP...</description></item><item><title>Go 1.27 将默认开启 SIMD for amd64，可移植 SIMD 包提案出炉</title><link>https://tonybai.com/2026/04/29/go-1-27-default-simd-for-amd64-portable-simd-proposal/</link><pubDate>Wed, 29 Apr 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/04/29/go-1-27-default-simd-for-amd64-portable-simd-proposal/</guid><description>本文永久链接 – https://tonybai.com/2026/04/29/go-1-27-default-simd-for-amd64-portable-simd-proposal 大家好，我是Tony Bai。 过去十年，Go 语言以其惊人的简洁和强大的并发能力，席卷了整个云原生领域。但在这片繁荣之下，一个尴尬的“阿喀琉斯之踵”，始终困扰着所有追求极致性能的 Gopher： **Go 语言...</description></item><item><title>为什么 Go 社区强调避免不必要的抽象？—— 借用海德格尔哲学寻找“正确”的答案</title><link>https://tonybai.com/2026/01/16/go-community-the-right-kind-of-abstraction/</link><pubDate>Fri, 16 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/16/go-community-the-right-kind-of-abstraction/</guid><description>本文永久链接 – https://tonybai.com/2026/01/16/go-community-the-right-kind-of-abstraction 大家好，我是Tony Bai。 **“Go 的哲学强调避免不必要的抽象。”** 这句话我们听过无数次。当你试图引入 ORM、泛型 Map/Reduce 、接口或者复杂的设计模式时，往往会收到这样的反馈。这句话本身没有错，但难点在于：*...</description></item><item><title>Go 安全的“隐形战争”：过去、现在与未来</title><link>https://tonybai.com/2025/09/25/go-security-past-present-and-future/</link><pubDate>Thu, 25 Sep 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/09/25/go-security-past-present-and-future/</guid><description>本文永久链接 – https://tonybai.com/2025/09/25/go-security-past-present-and-future 大家好，我是Tony Bai。 在软件安全领域，最成功的战役，往往是那些从未被公众所知的“隐形战争”。当一门编程语言的安全性被认为是理所当然时，这背后必然有一支团队在持续不断地进行着防御、修复与规划。对于 Go 语言而言，这支团队就是 Google...</description></item><item><title>purego 标签到底是什么意思？一场长达六年的社区辩论终于有了定论</title><link>https://tonybai.com/2025/08/01/proposal-purego/</link><pubDate>Fri, 01 Aug 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/08/01/proposal-purego/</guid><description>purego 标签到底是什么意思？一场长达六年的社区辩论终于有了定论 - Tony Bai Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关于我 * 我的技术专栏...</description></item><item><title>Go语言中的SIMD加速：以矩阵加法为例</title><link>https://tonybai.com/2024/07/21/simd-in-go/</link><pubDate>Sun, 21 Jul 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/07/21/simd-in-go/</guid><description>本文永久链接 – https://tonybai.com/2024/07/21/simd-in-go 前些日子，一些资深Gopher，比如fasthttp的作者Aliaksandr Valialkin因函数迭代器加入Go 1.23版本而抱怨Go的演进走错了方向：朝着增加复杂性和隐式代码执行的方向发展，而没有专注于Go语言的基本设计哲学——简单性、生产力和性能。Valialkin希望Go团队能专注于...</description></item><item><title>Goroutine调度实例简要分析</title><link>https://tonybai.com/2017/11/23/the-simple-analysis-of-goroutine-schedule-examples/</link><pubDate>Thu, 23 Nov 2017 00:00:00 +0800</pubDate><guid>https://tonybai.com/2017/11/23/the-simple-analysis-of-goroutine-schedule-examples/</guid><description>前两天一位网友在微博私信我这样一个问题： &amp;gt; 抱歉打扰您咨询您一个关于Go的问题：对于goroutine的概念我是明了的，但很疑惑goroutine的调度问题, 根据《Go语言编程》一书：“当一个任务正在执行时，外部没有办法终止它。要进行任务切换，只能通过由该任务自身调用yield()来主动出让CPU使用权。” 那么，假设我的goroutine是一个死循环的话，是否其它goroutine就没有执行...</description></item><item><title>利用缓冲区溢出漏洞Hack应用</title><link>https://tonybai.com/2011/12/01/hack-app-by-buffer-overflow-leak/</link><pubDate>Thu, 01 Dec 2011 00:00:00 +0800</pubDate><guid>https://tonybai.com/2011/12/01/hack-app-by-buffer-overflow-leak/</guid><description>我们在平时编码过程中很少考虑代码的安全性(security)，与正确性、高性能和可移植性相比，安全性似乎总被忽略。昨天从安全性角度泛泛地Review了一下现有的代码，发现了不少具有安全隐患的地方。我们的程序员的确缺乏系统地有关安全编码方面的训练和实践，包括我在内，在安全编码方面也都是初级选手，脑子中对安全性编码缺乏系统的理解。 市面上讲解编码安全性方面的书籍也不是很多，在C编码安全性方面，CERT...</description></item><item><title>也谈C语言的内联函数</title><link>https://tonybai.com/2011/06/22/also-talk-about-inline-function-in-c/</link><pubDate>Wed, 22 Jun 2011 00:00:00 +0800</pubDate><guid>https://tonybai.com/2011/06/22/also-talk-about-inline-function-in-c/</guid><description>有这样一段代码： /\* foo.c \*/ #include  &amp;#34;stdio.h&amp;#34; inline void foo() {     printf(&amp;#34;inline foo in %s\\n&amp;#34;, \_\_FILE\_\_); } int main() {     foo();     return 0; } 我采用C99标准，并在不加任何优化选项的情况下编译之： $ gcc -std=c99 foo...</description></item><item><title>发现一隐藏多年的Bug</title><link>https://tonybai.com/2008/09/06/found-a-bug-that-is-hidden-several-years/</link><pubDate>Sat, 06 Sep 2008 00:00:00 +0800</pubDate><guid>https://tonybai.com/2008/09/06/found-a-bug-that-is-hidden-several-years/</guid><description>C语言程序员在平时工作中，到底如何获取成就感呢？我几乎可以肯定的是：找到一个隐藏已久，多年无人发现的大Bug肯定可以归属到C程序员成就感的范畴中。与操作系统斗、与编译器斗、与内存斗，其乐无穷吗^\_^。 今天测试人员在进行平台迁移测试时发现一个致命的问题，导致系统不能正常工作。问题提到我这，为了不耽误测试进度，马上丢下手头的工作开始问题的查找，经过GDB多次跟踪调试，终于发现了一隐藏多年的问题，至...</description></item><item><title>switch语句性能考量</title><link>https://tonybai.com/2008/08/18/thoughts-on-the-performance-of-switch-case-statments/</link><pubDate>Mon, 18 Aug 2008 00:00:00 +0800</pubDate><guid>https://tonybai.com/2008/08/18/thoughts-on-the-performance-of-switch-case-statments/</guid><description>每年都有应届毕业生来到公司，每年都要对新同事进行代码方面的培训，比如编码规范就是其中之一。编码规范初听起来比较新鲜，但是培训时间长了，显然有些乏味。今年我打算改变策略，让新同事结合已有规范文档和项目代码，自己先挖掘一遍，然后大家通过坐下来讨论的互动方式来加深对规范的理解，每次讨论时间限制在1 hour以内，不给大家打瞌睡的机会^\_^。 上周和新同事一起讨论表达式和语句，说到了switch和if，...</description></item><item><title>小心'溢出'陷阱</title><link>https://tonybai.com/2006/09/06/be-careful-of-the-trap-of-overflow/</link><pubDate>Wed, 06 Sep 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/09/06/be-careful-of-the-trap-of-overflow/</guid><description>这几天以前曾经做过的一个项目上线测试了，果不其然，没有经过’战争洗礼’的产品就是靠不住，这不出了若干问题。害得我逃了半天课远程支持。 其中的一个问题很值得思考。其所在的模块并非是一个核心功能模块，而是一个提高系统Availability的一个功能模块，主要功能就是监视磁盘占用率。我们通过配置给出允许使用的磁盘空间大小(以M Byte为单位)，以及两个阈值，即当占用率达到多少的时候，Do A；达到多...</description></item><item><title>Kernel 'head.S'</title><link>https://tonybai.com/2006/03/02/kernel-head/</link><pubDate>Thu, 02 Mar 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/03/02/kernel-head/</guid><description>After being decompressed, the kernel image starts with another ‘startup\_32′ function included in $(linux-2.6.15.3\_dir/arch/i386/kernel/head.S’. This ‘head.S’ is the second one in linux source packag...</description></item><item><title>Compressed 'head.S'</title><link>https://tonybai.com/2006/02/25/compressed-head/</link><pubDate>Sat, 25 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/25/compressed-head/</guid><description>_Why do we do this? Don’t ask me.. Incomprehensible are the ways of bootloaders. _                             — comments in arch/i386/boot/compressed/misc.c There are two ‘head.S’ in linux source pac...</description></item><item><title>Transfer to '32-bit'</title><link>https://tonybai.com/2006/02/17/transfer-to-32bit/</link><pubDate>Fri, 17 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/17/transfer-to-32bit/</guid><description>The phase we talked about before is in ‘Real-address Mode’, which runs 16-bit program modules. At the tail of &amp;#34;Begin ‘setup.S’&amp;#34;, we had moved to ‘Protected Mode’, which usu runs 32-bit program modules...</description></item><item><title>Outline 'memory layout'</title><link>https://tonybai.com/2006/02/15/outline-memory-layout/</link><pubDate>Wed, 15 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/15/outline-memory-layout/</guid><description>So far we have arrived at the gate leading to the real kernel. And we’d better stop for a short break in order that we would have more energy to go ahead. Now let’s examine what we do to memory these ...</description></item><item><title>Begin 'setup.S'</title><link>https://tonybai.com/2006/02/13/begin-setup/</link><pubDate>Mon, 13 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/13/begin-setup/</guid><description>It is time for ‘setup.S’ to show its power. The ‘setup.S’ is loaded by the bootloader and virtually it belongs to neither the ‘bootstrap’ routine nor the kernel program, although it is a portion of th...</description></item><item><title>Goto 'Bootstrap'</title><link>https://tonybai.com/2006/02/11/goto-bootstrap/</link><pubDate>Sat, 11 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/11/goto-bootstrap/</guid><description>The term ‘Bootstrap’, which originally refers to a person who tries to stand up by pulling his own boots, refers to a subroutine used to establish the full routine(its own left part, i think) or anoth...</description></item><item><title>Inside the 'i386'</title><link>https://tonybai.com/2006/02/09/inside-the-i386/</link><pubDate>Thu, 09 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/09/inside-the-i386/</guid><description>The term ‘i386′ in the title does not refer to the real Intel 80386 processor but the representative of Intel 32-bit architecture(IA32). I prefer ‘i386′ rather than ‘IA32′ just like what the linux ker...</description></item><item><title>Retired 'bootsect.S'</title><link>https://tonybai.com/2006/02/08/retired-bootsect/</link><pubDate>Wed, 08 Feb 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/02/08/retired-bootsect/</guid><description>We know that the latest linux kernel version is 2.6.x, which is different from the ‘old kernels’ in booting. The ‘bootsect.S’, which used to make the kernel image in the floppy disk bootable in the ea...</description></item><item><title>汇编之路-复习栈操作</title><link>https://tonybai.com/2005/11/24/assembly-series-review-stack-operation/</link><pubDate>Thu, 24 Nov 2005 00:00:00 +0800</pubDate><guid>https://tonybai.com/2005/11/24/assembly-series-review-stack-operation/</guid><description>不得不承认上次关于栈桢和栈操作写得有些笼统，这里做一次“补充”，美名其曰：“复习”。 下面的这个例子几乎就能覆盖所有的栈操作相关的内容了。 void dummy() {         int     i = 12;         int     j = 13;         char    c = &amp;#39;a&amp;#39;; } int main() {         dummy();         re...</description></item><item><title>汇编之路-栈操作与栈帧</title><link>https://tonybai.com/2005/11/13/assembly-series-stack-oper-and-frame/</link><pubDate>Sun, 13 Nov 2005 00:00:00 +0800</pubDate><guid>https://tonybai.com/2005/11/13/assembly-series-stack-oper-and-frame/</guid><description>结构化程序的一个最基本的单元就是“函数”或者叫“过程”。在汇编这一层自然也相应的有支持这些概念的指令操作，如栈操作和栈帧的概念。 首先这里要为“打开汇编之门”那篇blog补充一点的是：汇编语言是与机器相关，这里的一切都是基于IA-32机器平台的。 1、寻址方式 我们已经知道在操作数表示中有一种是用来指示内存地址的内容的，在GNU Assembly中指示内存地址有多种方式，这些方式被统称“寻址方式”...</description></item><item><title>打开汇编之门</title><link>https://tonybai.com/2005/11/12/open-the-gate-to-assembly-language/</link><pubDate>Sat, 12 Nov 2005 00:00:00 +0800</pubDate><guid>https://tonybai.com/2005/11/12/open-the-gate-to-assembly-language/</guid><description>工作这么长时间，一直在C语言这一层面上钻研和打拼，日积月累，很多关于C的疑惑在书本和资料中都难以找到答案。程序员是追求完美的一个种群，其头脑中哪怕是存在一点点的思维黑洞都会让其坐卧不宁。不久前在itput论坛上偶得《Computer Systems A Programmer&amp;#39;s Perspective》（以下称CSAPP）这本经典好书，遂连夜拜读以求解惑。虽说书中没有能正面的回答我的一些疑惑，但是...</description></item></channel></rss>