Assembly coded project

Started by
14 comments, last by Ravuya 17 years, 8 months ago
Basicly for my final i have to code a game using only an assembably language and vga 8 colors. I just started today, but am very excited about the end project. I've been thinking of some games that i would like to make and wanted your opinions if its a good one. I obviously have no programing experience with assembly, i do have 4 years c++ and 2 years Direct-x. Tell me if this might be a reasonable game. Old'fassion duel basicly this is a two player game but is played with one keyboard and one computer. Player 1's guy is on the left side of the screen , player 2's guy is on the right. both players can move their guy up and down , they cannot move their guy left or right. They can press a button and fire a bullet that is headed toward their opponent respectivly. 3 hits and you win. do you think this would be easy to implement? is it too easy? i heard that it takes about 10 lines of assembly code to write about one line of code in c++. anyone else with different ideas let me know? (please no networking / MMORPG/ flight sim) lets keep it simple, since it is my homework!
Advertisement
Sounds very simple and very doable to me.

EDIT: Disclaimer: I've never written much assembly at all
Space Invaders?
----Bart
Quote:Original post by wizardpc
and vga 8 colors.

That statement implies to me that you are expecting to take some old DOS code and try copying it to write directly to the VGA buffer. You can't do that on modern OS's. You conceivably write a 16-bit app and let Windows' DOS emulation kick in but I don't really see the point. Plus you'd have to find a 16-bit assembler.

Your game idea seems reasonable. I was going to suggest Pong but that is even simpler.

Quote:i heard that it takes about 10 lines of assembly code to write about one line of code in c++

It depends a great deal on what that line of C++ does. It could translate to 1 assembly instruction or thousands.
-Mike
From what little I've coded in assembly that seems like a very reasonable goal.
This concept seems reasonable. I'm already figuring out in my head how to do it. I recommend starting by writing the appropriate C and converting it to assembly by hand, which is what I did in my various university courses regarding i386 and sparc asm.

Keep in mind that direct VGA access won't work on NT and other semi-evolved operating systems; you can probably use DosBox but you should be aware of this limitation.
Quote:Original post by Anon Mike
Plus you'd have to find a 16-bit assembler.


NASM can compile both 32-bit and 16-bit code. It would work perfectly for this sort of thing...

You can always set up the VGA mode in real-mode, and then go into protected mode for the rest of the game. This is assuming, of course, that it will not be running on a modern 32-bit OS, which I assume does not allow a 16-bit app running under emulation to thunk into protected mode...
Quote:(please no networking / MMORPG/ flight sim)

Damn, I was hoping you'd write a WoW clone ;)
You can always use DirectDraw from assembly in order to present your "video memory". That's what Windows ports of old DOS games do (well, they don't do it in assembly, but it's compiled, so there's little difference.)
Quote:Original post by Ravuya
This concept seems reasonable. I'm already figuring out in my head how to do it. I recommend starting by writing the appropriate C and converting it to assembly by hand, which is what I did in my various university courses regarding i386 and sparc asm.


That's a good idea. The only problem for a beginner will be incremental testing of the assembly code. What I would do after completing a C prototype is translate the graphics code first and test it by invoking it to draw some sprites around the screen. Then I'd begin working on the rest in a sort of outside-in fashion (relative to function call order.)

If wizardpc were experienced using GCC (DJGPP) and NASM, he could translate one function at a time and link it in with the rest of the C code.

Quote:
Keep in mind that direct VGA access won't work on NT and other semi-evolved operating systems; you can probably use DosBox but you should be aware of this limitation.


That's not true. Windows NT-based OSes (2K, XP) still allow you to run 16-bit and 32-bit DOS applications. Direct VGA access appears to be allowed, which means Mode 13h, Mode X, and other tweaked modes are usable. VESA is not usable.
Sound cards aren't usable (unless you run VDMSound); the PC speaker is.

----Bart

This topic is closed to new replies.

Advertisement