This is a minimalistic Snake game written in x86 Assembly, designed to run directly from the Boot Sector (512 bytes). The game demonstrates how to program at a low level, interacting directly with hardware without any operating system. It's a fun and educational project for anyone interested in bootloaders, retro programming, or assembly language.
- NASM: The Netwide Assembler for assembling the code.
- QEMU: An emulator for testing the bootable game.
- Optional:
genisoimage
for creating ISO files.
To build the binary (.bin
), disk image (.img
), and ISO file (.iso
), simply run: make all
- Create the build directory:
mkdir -p build
- Assemble the code into a binary file:
nasm -f bin src/snake.asm -o build/snake.bin
(Ensure NASM is installed on your system.) - Create additional formats:
- Disk image:
cp build/snake.bin build/snake.img
- ISO file:
genisoimage -o build/iso/snake.iso -b snake.bin -no-emul-boot -boot-load-size 4 -boot-info-table build/bin/
(Ensuregenisoimage
is installed.)
- Disk image:
Who needs Windows?
You can choose between the following commands to run the game in QEMU:
- Run the binary directly:
make run-bin
- Run the disk image:
make run-img
- Run the ISO file:
make run-iso
You can manually run the game in QEMU using one of these commands:
- Run the binary directly:
qemu-system-i386 -drive format=raw,file=build/bin/snake.bin
- Run the disk image:
qemu-system-i386 -drive format=raw,file=build/img/snake.img
- Run the ISO file:
qemu-system-i386 -cdrom build/iso/snake.iso
This project is licensed under the MIT License. See the LICENSE file for more details.