Sign in to follow this  

Assembly game-programming tutorials

This topic is 4273 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

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.



Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
You've got yourself a point there. Anyway...

I'm going to start writing some games in C. Which graphics library do you recommend: Allegro, SDL, OpenGL? I'd like to start with 2D games.

Share this post


Link to post
Share on other sites
Quote:
Original post by Patrick_
You've got yourself a point there. Anyway...

I'm going to start writing some games in C. Which graphics library do you recommend: Allegro, SDL, OpenGL? I'd like to start with 2D games.


I would personally recomend SDL, mainly because OpenGL has a rather steep learning curve for simple 2D work.

Share this post


Link to post
Share on other sites

This topic is 4273 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this