Computer Games That Teach Assembly Language
spectrum.ieee.org
spectrum.ieee.org
A lot of the problems are problems due to the architecture though, not necessarily hard to implement in more conventional architectures.
The article quickly goes over it, but for those who still wanna know more about the architecture, the TIS-100 is composed of nodes that can store a small number of lines of instruction code, have a working register, and have 4 I/O ports, UP, DOWN, LEFT and RIGHT. If asking for input, they will block until input is received from the specified adjacent node, and if passing output, they will block until the specified adjacent node asks for input. There are also memory nodes, introduced later in the game, to store more data.
These nodes are on a grid. Some of them are disabled, and the memory nodes' placement differs from program/puzzle to program/puzzle. Thus, careful selection of nodes and I/O ports is required for completion. I don't know if anything similar exists in actual hardware.
There's also a built-in "debugger" which simply allows you to run the program step by step and view all values, blocked nodes, and current instructions, which really helps, and possibly teaches players how to generally debug actual machine code. The programs run on a set of unit tests, and you can see which ones fail and why.
In classic Zachtronics fashion, there's graphs explaining your performance in the end, in terms of time, and space. Users not familiar with actual hardware architecture principles won't probably be able to figure out themselves how to get the best time, because most problems require use of pipeline-like instructions, due to the blocking nature of the nodes. So while it teaches tricks and fundamentals, I don't think it teaches more advanced and important stuff. And that's not a bad thing, it's a great game.
Would recommend to anyone.
GreenArrays GA144 has a few similarities. It's an array of tiny Forth-optimized cores, with some of them having specialized (mostly I/O) hardware. Apart from a few cores that are hardwired to boot from I/O pins, most need to be initialized via a neighbor. I don't remember where I saw this, but I remember reading that a rite of passage in GA144 programming is to write a "crawler" that loads itself into all of the cores.
> Nodes numbered in green have one or two GPIO pins. Those in blue have analog I/O. Those in orange have digital I/O with specialized purposes: 001 and 701 have high speed SERDES; 705 has four pins which may be used for an SPI bus; 217, 517 and 715 have a GPIO pin whose read line is connected to one or more analog nodes for sample synchronization; and nodes 007, 8, and 9 together control two 18-bit parallel buses and four GPIO pins that may be used to control external memory chips. These and the SPI bus are of course available for other uses if desired. All nodes are suspended after reset, prepared to execute instructions coming from any neighbor node via a comm port. Six of these are also waiting for incoming signals on their pin(s) which will be interpreted as boot frames. 001 and 701 SERDES will execute instructions received; 200 listens for high speed 1-wire protocol, 300 for 2-wire synch, 708 for RS232 framed async, and 705 can boot from an SPI flash memory device.
[1] http://www.greenarraychips.com/home/documents/index.html#arc...
Has GreenArrays scored any major sales (publicly), do we know if they have any future? It would be bit shame to see them go under.
Closest thing in actual hardware is a systolic array architecture. Green Array, Parallela and Google's new machine learning processors are examples.
I think the biggest difficulty is due to the tiny # of instructions allowed per node. It's like 10, right?
Which works very well for me as a player!
Or if you optimize for number of cells use, you need to figure out how to do multiple things in 10 instructions.
Actually, there is a whole class of parallel architectures called "Systolic Arrays" which TIS and Shenzhen I/O belong to:
it was a lot like programming a 32 bit arm, except there was a mov-to-my-neighbors file instruction .. and maybe full/empty bits?
It is perhaps the game of the genre.
For you parents out there...what has been your experience with/advice for teaching your kids a programming language? It's definitely something I want my kids to get comfortable/familiar with early but I get concerned about over-exposing them to too much "screen time" at a young age and the deleterious effects that might have (even ones we don't know about yet).
Don't have kids right now, or any on the way, but that's something on the horizon for me so I've been thinking about it.
Though one other consideration is eye strain. I'm still undecided on that one..
Though my original point was about kids.
http://www.nature.com/news/the-myopia-boom-1.17120
I use a hisense 43m3000 4k 43" (~$350 USD). It's great. Cheaper than eye surgery (and more pleasant.)
Though the registration seems like it's done by a human, manually approving registration requests, so don't be surprised if it takes forever to get an account!
There are some games that explore that direction (e.g. space engineers has some kind of programmable block), but no successful ones in the spirit of the original 0x10c vision (which was pretty vague and maybe the hype and high expectations killed it). I still think that one could build a great game around the main idea, but probably it is hard to balance the game mechanics between "real" programming and actual game play without alienating users that want to get into programming and actual programmers that want to play a game.
It's not a game, but I found it fun to write simple programs; the machine code is so limited you need to find tricks to do anything non-trivial. For a challenge, try to write 1: a program that multiples two inputs, 2: a sieve of erastothenes, and 3: a program that can sort input.
The spec for the assembler is on the wikipedia page.
I would only reccomend HRM for someone who has never done assembly.
Similar posts pop up occasionally here, such as:
https://news.ycombinator.com/item?id=13566247
A couple more lists of programming games:
- http://steamcommunity.com/app/375820/discussions/0/481115363...
- https://www.rockpapershotgun.com/2015/11/09/best-programming...
It's not mandatory, but it can be useful. The 3rd differential equations class may not be mandatory for a career in physics but it can be useful to understanding the foundations of the field. Learning Latin isn't mandatory for becoming an English teacher, but understanding the roots of words can be helpful.
If you can operate within those constraints, then you can build at a <$1 price point, and run on 2mW of power, less current than an LED. Heck, you could run the thing off of a joule thief, and pot the entire assembly in epoxy.
Fitting a pared down libC into that might be possible, but why bother? The system is so small and simple, that the rationale for a high level language doesn't really apply. Most of your code will probably just be bitbanging and setting control registers anyway.
But, most importantly, assembly is just plain fun, which is what will keep you coming back to the platform :)
On the other hand, learning some assembly helps even when you're not using assembly - it increases the understanding of how things work under the hood and helps your reasoning about performance and security considerations even when working in much higher level languages.
i can help you start (amd64), if you want. TIS-100 is a decent start as well