Assembly game-programming tutorials

Started by
10 comments, last by swiftcoder 18 years ago
Hey all, I'm interested in finding some game programming tutorials that use assembly as the main language. I use Linux and I use fasm as my assembler. Thanks for any input.
Advertisement
There will not be many tutorials on this. Assembly is hardly ever used to make games any more. Is there a reason why you want to use assembly?
I'm not familiar with any Linux ASM tutorials, as most are written for Windows and NASM/TASM. You'll definitely want to look into BIOS int 13h, as that is primarily used for controlling graphics and video (last time I checked).
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
You just won't find it, or at least not many. Don't rely on tutorials, they do more harm than good. Learn to program in assembler. Learn to interface with the libs you'll need. Then make a game. That's a lot of ground to cover, you certainly won't be learning all that from a "tutorial".

Oh, you will probably find stuff, but it'll be quite old and most likely no longer valid. There's just not many reasons to use assembly code for video game anymore. Yes, for optimizing small parts, but then you aren't "game programming" as much as you're implementing an algorithm. It's also getting harder to out-code your C compiler. Modern optimizing C/C++ compilers produce pretty good assembly code, a novice assembly coder probably won't be able to make it much (or any) faster.
Quote:Original post by programwizard
I'm not familiar with any Linux ASM tutorials, as most are written for Windows and NASM/TASM. You'll definitely want to look into BIOS int 13h, as that is primarily used for controlling graphics and video (last time I checked).


Definately NOT on Windows, no. You generally cannot access the hardware directly on protected mode operating systems. If you were programming for MSDOS, maybe, but only masochists or hardware nuts would want to do that now.
Quote:Original post by jonahrowley
Quote:Original post by programwizard
I'm not familiar with any Linux ASM tutorials, as most are written for Windows and NASM/TASM. You'll definitely want to look into BIOS int 13h, as that is primarily used for controlling graphics and video (last time I checked).


Definately NOT on Windows, no. You generally cannot access the hardware directly on protected mode operating systems. If you were programming for MSDOS, maybe, but only masochists or hardware nuts would want to do that now.


He is talking about Linux, but this will apply there too. You can use a DOS emulator, but there would be little reason to.
Quote:Original post by Roboguy
He is talking about Linux, but this will apply there too. You can use a DOS emulator, but there would be little reason to.


Oops, I meant Linux :P
Thanks for the replies. Yes, I knew I wouldn't find much on this; I've looked around, and couldn't find any. :)

The reason I want to write games in assembly is because, right now I'm learning assembly, and it would be a good learning experience. I know C and VB.NET (though only code in C and assembly anymore), but I'd rather get some game-programming with assembly under my belt before writing games in C. I love C, but so many people "before my time" have all started writing games and such in assembly, and, many of our greatest programmers have started out with assembly, so I'd like to do so also. Plus, assembly is fun, and the direct access to the hardware is great.

True, assembly isn't the smartest language for large projects; but still, I've never written a game before (just "regular" applications) and I think a good language to start with is assembly.



Quote:Original post by programwizard
You'll definitely want to look into BIOS int 13h, as that is primarily used for controlling graphics and video (last time I checked).


For the record, I confused into 10h and mode 13h for VGA. Sorry about that, OP. [embarrass]
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
Quote:Original post by Patrick_
Thanks for the replies. Yes, I knew I wouldn't find much on this; I've looked around, and couldn't find any. :)

The reason I want to write games in assembly is because, right now I'm learning assembly, and it would be a good learning experience. I know C and VB.NET (though only code in C and assembly anymore), but I'd rather get some game-programming with assembly under my belt before writing games in C. I love C, but so many people "before my time" have all started writing games and such in assembly, and, many of our greatest programmers have started out with assembly, so I'd like to do so also. Plus, assembly is fun, and the direct access to the hardware is great.

True, assembly isn't the smartest language for large projects; but still, I've never written a game before (just "regular" applications) and I think a good language to start with is assembly.


Just to clear up a few misconceptions.
ASM won't give you direct access to the hardware, *unless* you're either:
- running under MS Dos
- Writing your own OS or boot loader
- Writing a driver for an existing OS

So even from ASM, you still have to interface with the OS to get access to hardware in the usual way (which means through OpenGL/DirectX/whatever).
A lot of programmers started with ASM, yes. Because that was the only realistic option when they started out. Does that make them "better"? Nah, not neccesarily. Learning ASM does teach you some hints about how cpu's work, and what's fast and what isn't, but in their case, it's pretty damn useless. What was fast ASM those 30 years ago when they started, will be hopelessly inefficient today. They might still be good programmers (in some cases), but then it's because they've managed to keep up with the changes in hardware, ditch the old obsolete ASM-related knowledge, and still make use of their 30 years of experience.
Just keep in mind, 30 years ago, games programmers started out in ASM because it was the most obvious choice, and *not* because it's a good starting point today.
And a lot of them aren't "the best", they're quite sucky. Because they're still holding on to 30+ year old "optimization" advice.

I'd suggest starting with higher level languages, write a few games there, just to make sure you know exactly how everything is supposed to work. Then you can try to write one in ASM, because you're right, learning ASM is a good thing. It's just not a very logical starting point.

This topic is closed to new replies.

Advertisement