Follow and star our public account for exciting content.
Source: Content compiled from Wired.
In 1999, "Rollercoaster Tycoon" may not have been the most popular computer game. But if you delve beneath the pixels—wobbly rides, hungry, thirsty, and vomiting crowds (and the janitors trailing behind them)—and explore the code level, you will see the game's obsessive dedication to craftsmanship is almost insane. The game's sole developer, Chris Sawyer, wrote the entire game in assembly language.
Certain programming languages, such as Python, Go, or C++, are referred to as "high-level" languages because they operate somewhat like human languages, using commands and idioms that might be useful at a poetry reading. Generally, software like compilers translates these languages into something that machines can truly understand: blocks of data made up of 1s and 0s (or possibly hexadecimal) that tell the actual transistors how to work. Assembly language is the lowest of the "low-level" languages, almost directly corresponding to the machine's native tongue. It encodes directly on the machine. Developing a complex computer game in assembly language is like weaving a tapestry with shed cat hair.
Why would someone do this? Efficiency is one reason. In the 1990s, tools for high-level programming were not comprehensive. Compilers were very slow. Debuggers were also terrible. Sawyer could avoid these issues by using the universal language of Intel chips, x86 assembly language.
But we all know that this is not the real reason. The real reason is passion. Before turning to roller coasters, developer Sawyer wrote another game in assembly language, "Transport Tycoon." Players were responsible for managing a city's roads, train stations, runways, and ports. I (referring to the author Gregory Barber) imagine Sawyer as a model train enthusiast—laying down every piece of track, hand-sewing artificial grass, every detail a choice and a labor of love. To move these meticulously crafted pixels from bitmap to display, Sawyer had to fully exploit the chip's potential. "I created 'Rollercoaster Tycoon' because I understood the limits of possibility," he told me.
Working at the limits? In this age of abundant digital resources, where calling a function in AI training algorithms can mobilize millions of GPUs, that might seem like a foreign concept. Yet with assembly language, you can only get one thing, which is what you want—even if it’s wrong, as many programmers learn from painful experience. Assembly language is both cruel and beautiful. It demands that you express your intentions precisely.
I have let down the creators of assembly language. They wanted things to be simpler, not harder. I imagine they grew tired of loading punch cards and flipping switches on their steampunk behemoths. Perhaps they dreamed of a world like ours, where computers could do many things with minimal guidance.
The first assembly language was created by Kathleen Booth in the 1940s (though surprisingly, she has not always received the recognition she deserves). It was almost not a language at all. Code replaced code. To tell the machine to perform an operation—like inputting "0,0111" in machine code—you needed to use a series of letters and symbols, and then a new software called an assembler would convert it into binary. Soon, these commands became more human-friendly mnemonics like "MOV."
Understanding assembly is equivalent to understanding the CPU itself—what it can do and what it cannot do. The physical design of the chip, how the circuits connecting "AND" and "XOR" logic gates are laid out, determines how it works. Its functionality is very basic, breaking instructions down into a few fundamental steps: fetching data from memory and placing it into a temporary space called a register. Decoding it there. Executing some operations, such as comparing two values or adding them together. Returning data back to memory.
As chips advanced, new assembly languages emerged. The code that first sent humans to the moon was assembly language—it was designed for just one chip—that of the Apollo 11 guidance computer. If you want to read the leaked Furby source code, you need to be proficient in 6502. To hack your Ti-83 calculator, you need z80. Learning one chip's language—like Intel's x86—then switching to Arm is like learning Arabic in Beirut and then trying to get by in Tunisia or Khartoum. Good luck.
I studied x86 assembly in college when I was a math refugee. My classmates seemed to love the dullness of Java code, while I adored assembly as a logic game. Assembly is easy to make mistakes in, but if you look at the circuits and registers, you understand why mistakes happen. I felt I could skillfully use these simple commands that are less like a language to write code; but I also knew how fragile that skill was. That is, placing these bytes there—no, there, in that register, in those capacitors. Remember this. Forget that. Keep going, drawing each little statue one by one.
Admittedly, using assembly language in daily coding work has little significance anymore. High-level languages are highly efficient, and their abstractions are almost always more popular. Even the inventors of assembly language have turned to other fields; Booth used neural networks in a final paper in the 1990s to match the calls of seals. Sawyer has also changed careers. He recently started exploring home automation—lights, temperature sensors, sound systems, etc., all programmed in Python on a Raspberry Pi. He told me that at first, he found Python "quite off-putting." But even on that microprocessor, Python does a great job.
Then came something like DeepSeek, reminding us that humans can still communicate better with hardware. Earlier this year, a Chinese company that manufactured these efficient AI models disrupted the cliché that AI progress could only rely on more chips and more energy. Assembly language is a surprising reason. The engineers at DeepSeek delved deep into Nvidia chips, commanding each machine to compress data from 32 bits to 8 bits at the right moment—sacrificing precision for efficiency. Onlookers were stunned. Can you do that? The engineers at DeepSeek mastered an art that most people have forgotten.
I was equally shocked that in 2023, researchers at DeepMind taught a machine x86 assembly language and then let it improve the long-standing sort() function in C. The AI made some strange and counterintuitive choices, jumping between registers in odd ways, but ultimately reduced it by precisely one step. Perhaps saving less than a millisecond. But since the new algorithm was officially adopted, this has happened countless times every day.
For me, this reminded me that we humans created these machines, and even as they seem to become increasingly complex, beyond our understanding, they remain under our control. We can always make them work better. It’s like Sawyer said when he recently talked about programming experiments at home with Raspberry Pi. He thought it might just be his illusion, but the display was a bit laggy. He said that if he could, he would rewrite the code. Unfortunately, the assembly language used by Sawyer and that machine is not the same.
Reference link
https://www.wired.com/story/programming-assembly-artificial-intelligence/
*Disclaimer: This article is original by the author. The content reflects the author's personal views, and the reproduction is only to convey a different perspective, not to endorse or support that view. If there are any objections, please feel free to contact us.
‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧ END ‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧
Follow the WeChat public account "ZYNQ" and reply "join group" to join the FPGA/ZYNQ technology exchange group. Reply "m" in the background to see more exciting content.