Jump to content
  • Advertisement
Sign in to follow this  
Leo28C

Assembly lingo?

This topic is 3892 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quick question, guys: Can a normal human being make a simple game such as Pong, Space Invaders, Asteroids, or one of those classics... in pure Assembly language? From the little bit I've seen on it (all I can figure out as of now is the mov instruction) I say no, but what's the most 'advanced' pure ASM game ever done? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Leo28C
Quick question, guys: Can a normal human being make a simple game such as Pong, Space Invaders, Asteroids, or one of those classics... in pure Assembly language?
Yes. They certainly all were, so it had better be possible.
Quote:
From the little bit I've seen on it (all I can figure out as of now is the mov instruction) I say no, but what's the most 'advanced' pure ASM game ever done?

Roller Coaster Tycoon was written in assembly.

Share this post


Link to post
Share on other sites
I'm not entirely sure they were all done in assembly. I'm reasonably certain that some of them were done in machine code, and I believe the original version of Ms. Pac Man was done entirely in circuit design. That is to say, there wasn't a general purpose processor for it; the darn thing was custom made just to run the game.

Share this post


Link to post
Share on other sites
O________O
And I thought my Lua clone of Space Invaders was complex...

But what does 'machine code' mean? Please don't tell me someone can understand a program when opened with a hex editor... But if you say circuit design too, I bet it's possible.

*Is excited about learning ASM*

Share this post


Link to post
Share on other sites
personally, asm looks neat, gives you a lot of control over memory, but it seems like it would be a big hassle, though I've never used it.

Share this post


Link to post
Share on other sites
I believe the old Elite games were written in assembly. Now THAT must have been a monumental task. So yes, you could do anything in assembly that you could in any other language. It's just a question of how much work is involved :) .

Personally though, I refuse to touch assembly. a) I'm not a masochist and b) I'd only ever use it if I absolutely had to do something really low level, like create a device driver. For general programming, I'm not naive enough to think I could use it to create code that's more optimized than what modern compilers already produce. Add to that reduced readability and portability? No thanks :)

Share this post


Link to post
Share on other sites
Using assembly? Borderline waste of time because you're increasing development time of the code by an order of magnitude or more for a very tiny benefit.

Learning assembly? I'd say extremely useful, so that you have a better idea as to what your code is doing after compilation.

Quote:
Quick question, guys: Can a normal human being make a simple game such as Pong, Space Invaders, Asteroids, or one of those classics... in pure Assembly language?

All they had at the time was basically assembly language. One benefit of ASM is that you can squeeze out as much speed as possible with enough time. Back in the 70s, hardware was horifically slow, and any higher level language likely wouldn't compile well enough to work. Here's an excerpts from the wiki page on the 2600 that might give you some idea as to how weak it was:
Quote:
The CPU was the MOS Technology 6507, a cut-down version of the 6502, running at 1.19 MHz in the 2600.
...
The console had only 128 bytes of RAM for runtime data that included the call stack and the state of the game world. There was no frame buffer, as the necessary RAM would have been too expensive. Instead the video device had two bitmapped sprites, two one-line "missile" sprites, a one-pixel "ball," and a "playfield" that was drawn by writing a bit pattern for each line into a register just before the television scanned that line. As each line was scanned, a game had to identify the non-sprite objects that overlapped the next line, assemble the appropriate bit patterns to draw for those objects, and write the pattern into the register. By default the right side of the screen was a duplicate of the left; to control it separately, the software had to modify the patterns as the scan line was drawn. After the controller scanned the last active line, a more leisurely vertical blanking interval began, during which the game could process input and update the positions and states of objects in the world. Any mistake in timing produced visual artifacts, a problem programmers called racing the beam.

Share this post


Link to post
Share on other sites
Regards the original question :
Yes, it is possible to write a full game in assembly language. dont forget that a C/C++ compiler 'compile' your C/C++ files to a assembly code / machine code.

Should we write a pure asm game ? only if you want to challange yourself. even in the 80/90 when assembly was required to get decent frame rates, only rare games were programmed only in assembly language. most of the games had their engine use alot of assembly language for optimization but the game logic were all developed in high level language.

Should you learn assembly ? I would say hell yes !. understand your machine assembly code will help you in many cases. a big help would be to help you find some internal bugs. dissasembly your code sometimes just show you the bugs. it can be very useful when writing in C++, because C++ hide some of its work from the user.

Because I am in the low level programming, I have found tons of other uses to assembly. mostly in understanding what the system does. sometimes even to find a bug in the core of the operating system.

Nuno1

Share this post


Link to post
Share on other sites
I never would have gotten into programming if it was all assembly, punch cards, circuits, or any of that other low level stuff when I went to school. I just don't have the patience to dick around with that kind of punishment.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cypher19
Using assembly? Borderline waste of time because you're increasing development time of the code by an order of magnitude or more for a very tiny benefit.
Borderline waste? Total waste! Tiny benefit? Much [MUCH] more often than not, NO benefit! [huge detriment would be a more accurate means of describing the preference for hand-tuned over compiler-tuned code]

Frankly, the only reason to do assembly these days is to get access to functionality that isn't exposed through native language primitives. Commands like CAS and LL/SC are damn useful, as are certain old memory move commands, yet contain meaning that isn't expressed by any higher-level command. With the exception of that though, top-of-the-line compilers are sophisticated enough these days to code circles around 99% of programmers [99% being the conservative estimate put in place because '100%' would result in people finding crumby compilers that they can outperform with hand-tricked code].

Assembly for general purpose though? Learn what it is, what it does, and why you shouldn't use it...

Then don't use it.

Glance at it, and don't use unless you can't do something without it [note the wording 'CANT do something without it', not 'think you can do better']

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!