The Snake Game is a classic arcade game implemented in assembly language for the 16-bit Stump processor.
- Dynamic gameplay with a snake that grows as it consumes food.
- Collision detection.
- Real-time score updates.
- Simple graphics displayed on an 8x8 LED matrix.
The development of this game was guided by the following constraints imposed by the 16-bit Stump processor:
- The Stump processor supports the following operations:
- Data Operations: ADD, ADC, SUB, SBC, AND, OR, with optional immediate values.
- Memory Transfers: LD (load) and ST (store) with addressing modes including register direct, immediate offsets, and labels.
- Control Transfers: Conditional and unconditional branch instructions, e.g., BEQ, BNE, BGE, BLT, etc.
- Pseudo-Operations: MOV, CMP, TST, implemented as combinations of basic instructions.
- Immediate values in instructions are limited to 16 bits.
- Peripherals are memory-mapped starting from address
FF00. The game uses the following peripherals:- 8x8 LED Matrix: Address range
FF00-FF3Ffor displaying the game grid. - Buttons and Switches: Address
FF91for player inputs.
- 8x8 LED Matrix: Address range
- The processor has limited register and memory resources, requiring efficient use of registers and stack management.
- The system uses a 16-bit free-running counter at address
FFA4for timing purposes.
- Clone the repository containing the game source code:
- Assemble the code using the Stump assembler provided in your development environment.
- Load the assembled binary onto the Spartan 6 board.
- Start the game by executing the loaded program.
- Use the buttons on the Spartan 6 board to control the direction of the snake.
- Guide the snake to consume the food that appears on the grid.
- Avoid collisions with the walls and the snake's own body.
This project was developed as part of the COMP22111 coursework, exploring the use of assembly programming for the Stump processor and its associated peripherals.
For any questions or support, please contact Serhii Tupikin.