Skip to content

goudunz1/Snake86

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake86 - Snake of 8086

I. Introduction

Snake86 is a tiny snake game in ~200 lines of MASM 8086 assembly.

A DOS system (if you really have one) or a simulator like DOS-Box is needed to
run the program. MASM toolchain is needed to compile the source. When you are
ready, simply run build.bat.

  BUILD/PLAY.EXE  the playable binary
  snake86.txt  this documentation

test platform: DOS-Box 0.74

II. Rules

  w  Controls your snake to go up
  a  Controls your snake to go left
  s  Controls your snake to go down
  d  Controls your snake to go right
  q  Halt the game

  Press any key to quit to the command line when the game is stopped.

Your goal is to grow as long as possible in a 80*50 sandbox and avoid collison
with the wall or yourself. The sandbox is made up of 4*4 blocks - green for
snake body, red for fruit and white for the wall.

Your snake starts at block(1,1) heading right with 1 length. Eating a fruit
would increment its body length by 1. When your snake dies the game is stopped.
It has only 1 health point so be careful.

III. About

This program was originally a demo I made to test my understanding of the 8086
language. It took ~700 lines of MASM assembly so I decided to improve its
performance and shrink the size of its source code.

Have fun if you find it interesting or useful. It feels bad to mess with all
the calling conventions, though.

last updated on Jan 18, 2024
  by goudunz1