📜 ⬆️ ⬇️

Space Invaders: now in 512 bytes (Assembler x86)

image

It would seem that quite recently Space Invaders fit into 1 kilobyte , and now they could fit in one boot sector (512 bytes). The author of the program is Oscar Toledo, a five-time winner of the IOCCC ( International Obfuscated C Code Contest ) and a regular JS1K participant, also known as the creator of chess, which occupy only 392 bytes .

The source code of the game can be viewed in the repository on Github: github.com/nanochess/Invaders

To run you need nasm (Netwide Assembler), which can be downloaded from the official website . The game can be assembled by running the command:
')
nasm -f bin invaders.asm -Dcom_file=1 -o invaders.com 

In fact, it is still 4 times larger than the entire size of the Atari 2600 RAM - but it would easily fit into its cartridge, which provided 2 kilobytes of memory. Also, the use of the PUSHA/POPA assembler instructions in the program code requires a processor of 80186 or higher.

The original Space Invaders was released in 1980 and became one of the first arcades ported to the Atari 2600 from slot machines. The game became a bestseller, which increased sales of the console itself by 4 times. The original game, which appeared on the arcade machines in 1978, according to its author, was in turn inspired by another Atari game - Breakout.

The demonstration of the game can be viewed on video.

Source: https://habr.com/ru/post/454872/


All Articles