Space Invaders: now in 512 bytes (Assembler x86)

    image

    It would seem that quite recently Space Invaders fit in 1 kilobyte , but 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 regular member of the JS1K, 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 on 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 could easily fit on its cartridge, which provided 2 kilobytes of memory. Also, the use of assembler instructions in the program code PUSHA/POPArequires a processor 80186 and 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, increasing sales of the console itself 4 times. The original game, which appeared on arcade machines in 1978, according to its author, was in turn inspired by another Atari game - Breakout.

    A demonstration of the game can be seen in the video.


    Also popular now: