Photo: Randi Klett
Ah, assembly. Where all the pretense of high-level languages—the program structures, the data handling, the wealth of functions—gets stripped away. You get branches, bytes, and if you’re lucky, a subtraction command. True, directly manipulating the state of a computer can be powerful, but few people code in assembly by choice.
So I was surprised to find not one but three polished games that do a surprisingly good job of making coding in assembly language fun. To be clear, none of these titles involve writing assembly for real hardware. They all use virtual systems with minimal instruction sets. Still, they do capture the essence of assembly coding, with complex behaviors squeezed out of simple commands.
The first game is Human Resource Machine, originally released in 2015 by Tomorrow Corp. and now available for Windows, Mac, Linux, and the new Nintendo Switch. In this game the player takes on the role of an office worker who must handle numbers and letters arriving on an “in” conveyor belt and put the desired results on an “out” conveyor belt. As you begin, you’re given just two instructions to work with. As you progress and face more complex challenges, more instructions are provided. Challenges range in difficulty from outputting the larger of a pair of input numbers to sorting variable-length sequences.
Inside the Machine: Human Resource Machine (top) pretends to be an office. TIS-100 emulates an ’80s microcomputer interface (middle), while Shenzhen I/O combines coding and wiring (bottom).Photos, from top: Tomorrow Corp.; Zachtronics (2)
Because Human Resource Machineis highly abstracted, someone could play it as a straight puzzle game and be little the wiser. But those in the know will recognize the office worker as a register, the temporary workspace on the office floor as random access memory, and many of the challenges as classic introductory computer science problems. Because the game starts out with so few commands, and the interface is so intuitive, it would make a great way to initiate beginners into the inner workings of processors. However, the game’s story line doesn’t do all that much to motivate players to keep completing levels.
TIS-100, from Zachtronics, solves this problem, albeit by presupposing a more sophisticated player. Also originally released in 2015, TIS-100 is now available for Windows, Mac, Linux, and the iPad. The iPad version (released in 2016 as TIS-100P) gives perhaps the clearest idea of who the game is targeted to, as a monochrome text display is joined by an onscreen keyboard that looks (and clacks) just like what you’d expect to find attached to an old-school micro. And indeed, the game is a nostalgic tour de force, complete with a downloadable manual that will provide a pang of recognition for anyone who was programming in the 1980s: It’s designed to look exactly like a second- or third-generation photocopy of the most important bits from the actual manual.
The story line for the game is that you’ve inherited a TIS-100 computer from your Uncle Randy. By solving problems in assembly, you unscramble corrupted portions of the computer’s memory, providing hints as to the machine’s original purpose. The TIS-100 has an unusual parallel architecture, being composed of computational nodes that pass messages to each other. The puzzles escalate fairly quickly in complexity, but all are doable, and if you’re looking for something to take you back to a romanticized version of what it was like to code back in the day, TIS-100 can’t be beat.
Zachtronics, though, also brings us bang up to the present with its latest title, Shenzhen I/O, released last November and available for Windows, Mac, and Linux. In this wry game, you’re a Western electrical engineer who’s decided to go where all the actual stuff is getting made these days—Shenzhen, China. Shenzhen I/O shares key game mechanics with TIS-100—programming interconnecting modules to accomplish tasks—but it introduces a wide array of different modules (complete with faux datasheets) such as radios and displays. In Shenzhen I/O, the name of the game is getting the timing of signals just right so as to pass input/output test suites for the various electronic devices you’ve been hired to build. Many of the products are amusing, and EEs will find much to recognize, right down to the occasional judicious deployment of a NOP (no operation) instruction to get a timing cycle spot on.
This article appears in the May 2017 print issue as “Some Assembly (Language) Required.”