Low End Virtual

One of My Faves: Sharpen Your Assembly Language Skills with TIS-100! (And it’s 50% Off Right Now)

TIS-100I’ve always been fond of code-writing games.  I was an avid Core War player in the 90s, for example, and I learned Redcode (the x86-ish assembler used in the game) before I learned x86 assembler.  Writing code in a sandbox with “real game consequences” is a great way to learn the fundamentals of problem-solving via programming.

A few years ago I crossed paths with TIS-100, a fun game where you write assembler to solve various problems.  The machine you’re working on is quite different than the typical x86 box.  It’s a series of interconnected nodes that can pass data through ports, and each has its own accumulator and secondary register.

Here’s an example of the game interface.  I took this screenshot on an iPad, but it’s available on Steam (for Windows and Linux) as well.

And I just noticed it’s 50% off at present!  Here in the US, it’s only $3.49 through July 9

TIL100-P

If you tap into any of the nodes, the full keyboard is brought up.

The progresses through a series of problems.  This is one of the simpler ones – you’re reading values and writing them to different outputs.  Here’s what a run looks like:

You can read the full manual for the game here.  The assembly language is small.  Besides labels and comments, there are only 13 commands.

Here’s an example program:

START: 
  MOV UP, ACC 
  JGZ POSITIVE 
  JLZ NEGATIVE 
  JMP START 
POSITIVE: MOV ACC, RIGHT 
  JMP START 
NEGATIVE: MOV ACC, LEFT 
  JMP START

If you’ve done any assembly programming, you’ll probably understand that.  If not, consider that

  • “JGZ” is “Jump if Greater Than Zero”
  • “JLZ” is “Jump if Less Than Zero”
  • Both of those operate based on the value of ACC.  So if the value of ACC is 8, and you say “JGZ”, then it will jump.
  • “JMP” is an unconditional jump

There is, of course, an over-arching story, but the joy is in working through the problem solving.  Enjoy!

 

No Comments

    Leave a Reply

    Before you comment
    • Please use your hosting provider's support system for service issues.
    • Comments may be held temporarily for spam review.
    • Use <pre>...</pre> for terminal output, or link to a paste service.

    Your email address will not be published. Required fields are marked *