Wednesday, April 20, 2011

Space Opera, an x86 assembly arcade game

Screenshot of Space Opera, in action

Back in 2008, as a freshman in my second semester of college, I wrote a game in x86 assembly language as my final project for a core computer science class I was taking. The class was Computer Systems Organization, taught by Professor Nathan Hull and I think it was one of the more important classes that I took. This class came fairly early in the track (once you were out of the introductory Java classes) and it was one of the classes that began to explore the field of programming and computer science on a lower level than contrived OOP simulations of unrealistic problems.

A lot of people do not like learning assembly and it certainly is directly inapplicable in most fields these days, however I am one of the people who believes it is very important to at least have some experience in it because you really start to understand what is happening behind the scenes in any language once you have worked in it. To have such a low level knowledge of what is happening is useful and interesting, and I credit this class with helping to draw a clear line between my high school self and post-high school self in terms of understanding paradigms beyond introduction-to-Java type programming. Not to say that all the work I did in high school was that simplistic or bad, but that the mentality I had was rooted in easy to digest examples of OOP paradigms from introductory books and this starts to become limiting, at a point.

The game I wrote is entitled Space Opera. It is a very simple "shoot at the enemies flying down from the top of your screen as you fly through space" game.

Being written in assembly, almost every line is commented. You can view the standalone Space Opera source, but you need to download the full package if you want to actually assemble it.

The Space Opera binaries and source code are released under the MIT License, however the ZIP file contains some free files with no licensing information including an educational assembler and debugger and a random number generating library. All of these extra files are from the NYU Computer Systems Organization homepage (for Spring 2008) and were given to us to use. I am mirroring them on my servers. That is the extent of the licensing I know of. The compiler and debugger are written by Robert Dewar and the random number generation library is written by Wilson Seto. My code borrows some routines from Robert Dewar's Game Program, another educational file by Robert Dewar, which is free of licensing information and given to us to use. It is available on the course website as well. The sections in my code that have been borrowed are clearly marked as such.

In order to run the binaries, cd to the directory (at the DOS command line or in DOSBox if you do not have Windows) and run spopera.bat. If you would like to use the assembler, cd to the src directory and type das.com <source file>. An outputted ".com" and ".lst" file should appear bearing the same name as the source file. The ".lst" file is for debugging and the ".com" file is the executable.

6 comments:

  1. Oh man do I love space. Like being in a spaceship. And eating dehydrated ice cream. And eating moon cheese with my dog Grommit. Good times, man. Good timez.

    ReplyDelete
  2. For example, in the event that you might want to play poker you could sort "free poker recreations" in your program. You are certain to get a great deal of results and you'll have the capacity to play poker for nothing for whatever length of time that you might want. navigate here

    ReplyDelete
  3. Hello there! This post could not be written any better! Reading through this article reminds me of my previous roommate! He always kept talking about this. I am going to send this post to him. Pretty sure he will have a very good read. I appreciate you for sharing! Check This Out

    ReplyDelete
  4. Chances are that everyone remembers some of the most popular games that started out as arcade games:
    Labyrintoom Escape Instagram profil

    ReplyDelete
  5. Not like in the arcades where he could be humbled in front of the masses, but this arcade game jewel would serve my purposes none the less.http://trichefortnite.fr

    ReplyDelete
  6. Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.
    ssf2online.info

    ReplyDelete