CAS Community   >   Resources   >  

no image
Write a complete Snake game in AQA Assembly Language

Comprehensive Student Workbook and companion Teacher's Guide with instructions to write a complete Snake video game in less than 100 machine code operations - to run on Peter Higginson's AQA Processor Simulation

Richard Pawson

Created by Richard Pawson
last edited Jan 07 2020 by Richard Pawson

UPDATE (7/1/2020): Please note that an updated and improved version of this resource, now appears within my Assembly Language Programming book, which may be downloaded from here. RP.


This resource was created as a response to the difficulty of engaging pupils with assembly language programming when using only trivial examples such as adding two numbers, or finding the largest of three values. I wanted, instead, to give pupils the experience of writing a program that:

  • Was non-trivial in difficulty (of the order of 100 machine instructions)
  • Delivered a rewarding result
  • Was appropriate to be written in assembly language

Most people who’ve played a few video games will have encountered ‘Snake’ at some point - probably on a PC or phone. Despite its simplicity it is a very engaging game, and many pupils will be keen to play it, and compete to achieve the longest snake.

Today’s pupils are just about old enough to remember simple hand-held video games that featured low-resolution liquid crystal displays. Those devices typically had 8-bit microprocessors and very limited memory. The games on those devices, such as Snake - all of them simple by today’s standards - had to be written in assembly language both for speed of execution and size.

The implementation

The implementation presented uses less than 100 machine-level instructions. It is written for the AQA Assembly Language, which is designed for an imaginary Risc processor loosely based on an ARM processor.
The Snake program will run on Peter Higginson’s online AQA Processor Simulation . However, it would not take a great deal of effort to modify the final code to run on a real ARM processor, as used on the Rasberry Pi, equipped with a suitable memory-addressable display.

As well as helping to teach AQA Assembly Language programming, the exercise provides strong reinforcement for some other ideas covered in the A-level Computer Science syllabus such as:

  • Agile software development methodology
  • Linear and Circular Queue data structures (introduced in Story 7 and 8)


I am deeply indebted to Peter Higginson for:

  • Creating and freely sharing his excellent online processor simulators. (He is best known in schools for his LMC simulation).
  • Making several significant extensions, such as the addition of a memory-addressable graphics display, to the AQA simulation specifically to enable this Snake project. The changes he made for this project are detailed here under ‘Version 0.7’.
  • Providing me with a great deal of advice and guidance on the Snake coding itself, on an almost daily basis throughout January.

There are many implementations of Snake. I was originally inspired by Nick Morgan’s version written for the 6502 (the last processor I wrote real assembly Language software for, back in the early 1980s). The version presented here started as a translation of Nick Morgan’s version into AQA code, but has ended up very different.

Level: Advanced

Teaches: - Assembly Language programming (using AQA specification) - Immediate, Direct, Indexed, and Indirect Addressing Modes - Agile software development methodology - Linear and Circular Queue data structures - Simple game design

Downloaded 2547 times.


This resource has attached files: to access these files, please tick the box below to assent to the license terms
License: The resources on CAS website are under Creative Commons Attribution-Share Alike 3.0 licence unless otherwise specified by the resource creators.

You must confirm that you have read and agree the licence's ToS before you can download the attachments of this resource.

I have read the licence agreement of this resource and agree to abide by its terms and conditions.

Feedback and Comments

Available when logged in (join via the front page, for free):
  • View 14 comments on this resource.
  • View resource history, links to related resources.
  • Leave feedback for the author(s), or help by editing the resource.

© 2021 BCS, The Chartered Institute for IT Registered charity: No. 292786
Using the websiteDisclaimer of liabilityCookies policyPrivacy notice