{"assets":[],"author_link":"author\/megabrutal\/","author_name":"MegaBrutal","cat":"LD #26","categories":["LD #26"],"comments":[],"epoch":1371065520,"event":"LD26","likes":5,"metadata":{"p_key":"79345","p_author":"MegaBrutal","p_authorkey":"0","p_urlkey":"288355","p_title":"Minimal game in x86 assembly","p_cat":"LD #26","p_event":"LD26","p_time":"1371065520","p_likes":"5","p_comments":"0","p_status":"WAYBACK","us_key":null,"us_name":null,"us_username":null,"event_start":"1366934400","event_key":"16","event_name":"LD26"},"source_url":"2013\/06\/12\/minimal-game-in-x86-assembly\/","text":"<p>I took part in <em>Ludum Dare #26<\/em> with <a href=\"http:\/\/www.ludumdare.com\/compo\/ludum-dare-26\/?action=preview&amp;uid=16637\" target=\"_blank\">a minimal DOS game written in x86 assembly<\/a>. Though I couldn\u2019t finish the game within 48 hours, I got some really nice feedback, also I saw some more potential in the game, which eventually inspired me to finish it after the compo. <img alt=\":)\" class=\"wp-smiley\" src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/simple-smile.png\" style=\"height: 1em; max-height: 1em;\"\/><\/p>\n<p>The game is now (somewhat) playable. It has a HUD which shows your health, how many treasures you collected, and how many monsters you killed. Also, the field is randomly generated, and if you leave the screen, you get a new field (as if you left the previous one). Also, whenever you kill a monster (or you get killed by one), a random name is selected from a list of races \u2013 some of these races are <a href=\"http:\/\/tvtropes.org\/pmwiki\/pmwiki.php\/Main\/ShoutOut\" target=\"_blank\">shout-outs<\/a> to various indie games I love \u2013 I suggest all the referenced games for everyone to check out. \ud83d\ude09<\/p>\n<p>Some added awesomeness to this game (which I\u2019m really proud of) is that it\u2019s OS-independent: though it runs natively under DOS, it doesn\u2019t actually require DOS to run. To prove this, you can actually write the binary image into the boot sector of a floppy (and possibly other bootable storage media) and then you can directly boot your PC with it. The binary is exactly 3 sectors long, and it contains a boot code which loads the rest of the game if it\u2019s booted by BIOS. Since the game only depends on ROM-BIOS calls those are available in all IBM-compatible PCs since the 80s, the game will run without a traditional operating system \u2013 in other words, technically the game will function as your operating system. \ud83d\ude09 (Though I can\u2019t prove it, theoretically this code should run even on the earliest IBM PC model, as well as on today\u2019s PCs. Though I\u2019m not entirely sure that all BIOS functions I used were available since the very beginning.)<\/p>\n<p>Originally I intended to include a <em>readme.txt<\/em> file for the program, but I found the source code itself is quite self-documenting. So just read the source code and you will find all information you need. (I advocate the \u201c<em>code is design<\/em>\u201d\u00a0philosophy anyway. :P)<\/p>\n<p>We must admit, this game is rather a computer science experiment than an actual game. It\u2019s not very fun, I must admit. \ud83d\ude00<\/p>\n<p>You may get the updated game here:<\/p>\n<p><a href=\"http:\/\/games.megabrutal.com\/minimal\/minimal.asm\" target=\"_blank\">ASM source<\/a><br\/>\n<a href=\"http:\/\/games.megabrutal.com\/minimal\/minimal.zip\" target=\"_blank\">ZIP package (contains the source code and the compiled .COM file)<\/a><\/p>\n<p>Basically, I had two motives to make this game. One is nostalgia. I remember having fun times reading one of <em>Peter Norton<\/em>\u2018s books on assembly programming when I was 13 or 14 (that was like 10 years ago) <del>while others were learning how to get girlfriends<\/del>. Then during high school\u2019s carefree times I started to work on a hobby operating system I called <em>ShitOS<\/em>, which would have been entirely implemented in assembly \u2013 I was very far from finishing it when I gave it up \u2019cause I had to realize I don\u2019t have enough free time to work on it. The other reason I made this game is that I think assembly is totally awesome! First, it even looks awesome, I\u2019d totally decorate my walls with it! Second, it does great to the programmer\u2019s soul. To master assembly, you need to understand how the computer works on a deep level, which is a <em>de facto<\/em> requirement for all good programmers.<\/p>\n<p>Anyway, possible that I\u2019ll develop this game further whenever I get this assembly-fever again. \ud83d\ude09<\/p>","time":"June 12th, 2013 7:32 pm","title":"Minimal game in x86 assembly","title_was_empty":false}