Skip to content

pushkarsinghh/snake8086

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ Snake Game in 8086 Assembly

A classic Snake game implemented in 8086 Assembly Language for Computer Organization and Architecture course project.

Game Status Assembly Platform

๐ŸŽฎ Features

  • Arrow Key Controls: Smooth directional movement
  • Food Collection: Eat '@' symbols to grow and score points
  • Score Tracking: Real-time score display on screen
  • Dynamic Growth: Snake expands with each food consumed
  • Screen Wrapping: Seamless boundary wrapping for continuous play
  • Color Graphics: Colored head (yellow 'O') and food (red '@')
  • Pure Assembly: 100% hand-written 8086 assembly code

๐Ÿš€ Quick Start

Using emu8086 (Recommended)

  1. Open snake.asm in emu8086
  2. Press F5 to compile and emulate
  3. Press F5 again in emulator to run
  4. Press any key at welcome screen to start playing

Game Controls

Key Action
โ†‘ โ†“ โ† โ†’ Move snake
ESC Exit game

๐Ÿ“Š Game Mechanics

  • Starting Length: 7 segments
  • Maximum Length: 15 segments
  • Score: +1 point per food item
  • Food Symbol: @ (red)
  • Snake Head: O (yellow)
  • Speed: ~4.5 updates per second

๐Ÿ› ๏ธ Technical Details

Language:     8086 Assembly
Assembler:    emu8086 / MASM / TASM
Platform:     MS-DOS (Real Mode)
File Format:  COM executable
Memory:       ~600 bytes total

BIOS Interrupts Used

  • INT 10h: Video services (display, cursor)
  • INT 16h: Keyboard input (polling)
  • INT 1Ah: System timer (delay & randomness)
  • INT 21h: DOS services (text output)

๐Ÿ“ Project Files

snake-game/
โ”œโ”€โ”€ snake.asm              # Main source code
โ”œโ”€โ”€ design_diagram.txt     # System architecture diagram
โ”œโ”€โ”€ README.md              # This file
โ””โ”€โ”€ PROJECT_REPORT.md      # Detailed technical report

๐ŸŽฏ Learning Outcomes

This project demonstrates:

  • Direct hardware programming via BIOS interrupts
  • Memory management in segmented architecture
  • Real-time input handling and game loop design
  • Low-level algorithm implementation
  • Assembly language debugging techniques

๐Ÿ”ง Customization

Adjust game speed in game_loop:

add dx, 4   ; Change 4 to: 2 (faster) or 6 (slower)

Change maximum snake length:

s_size  equ  15   ; Increase to 20, 30, etc.

๐Ÿ“– Documentation

For comprehensive technical documentation including:

  • System architecture details
  • Algorithm complexity analysis
  • Implementation challenges and solutions
  • Performance metrics
  • Test results

See PROJECT_REPORT.md

๐Ÿ› Known Issues

  • No self-collision detection (snake can pass through itself)
  • Food may occasionally spawn on snake body
  • No pause functionality

๐ŸŽ“ Academic Information

Course: Computer Organization and Architecture
Topic: Game Development in Assembly Language
Objective: Master low-level programming and computer architecture concepts

๐Ÿ“„ License

Educational use only. Created for academic purposes.


โญ Star this project if you found it helpful!
๐Ÿ“š Check out PROJECT_REPORT.md for in-depth technical analysis

About

๐Ÿ Snake Game made using 8086 Assembly Language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published