I've written dos games in c and I'd like to get started writing windows games in asm. Can anyone recomend any tutorials that explain how to use directx 8 from asm.
Posted on 2001-10-18 22:26:36 by Predator
Maybe you should start coding games for Windows using C++ first instead of Asm.
It is always harder to start a project in Asm than starting it in C++ and then rewriting it to Asm when it's finished. OK, maybe it takes up more time, but if you aren't a good Win32Asm programmer yet I think that this is the best thing to do (you also learn faster this way).
A couple of days ago I was rewriting a little OpenGL test that I've done in VC++ and I rewrote it entirely in Win32Asm. It was really easy to look at the C++ code and rewrite all my functions into Asm, and it worked fine. I think if I had to code the entire OpenGL test in Asm without a C++ reference I would never finish it, because having to think HOW to make it, WICH OpenGL functions to use and then coding it in Asm is too much for me because I'm not an Asm Guru. When I start learning something new, (Ex: OpenGL) I always use C++ because I know that my code will be full of errors, so I need a good compiler with a lot of error messages that tell me exactly whats wrong.

Predator wrote
Can anyone recomend any tutorials that explain how to use directx 8 from asm.

Using DX8 in Win32Asm is almost the same thing than using it in C++, so learn it in C++ and code it in Asm when you already know DX8.
Posted on 2001-10-20 06:08:25 by eeprom
Strange how it is opposite for me:

it is allways easyer to write a game in Win32ASM and then rewrite it in C/C++. Notabley i can write the game 10x faster then in C++, and the game will also run 10x faster and i will have about 10x more control of the PC....

oh yeah and the learning curve for ASM is about 10x faster that C++ (esp MFC and DirectX)

tested it on my blank workers.....(the had no prior knowledge or either C++ or ASM and learned ASM about 10x faster)

after all there are only a few registers and some basic operations... the rest is typeing and thinking to the algorithms...

no red tape from MFC or useless Classes


Start with Chris Hobbs "SpaceTris" on GameDev its a tetris clone with full source code written in Win32asm and using DirectX/DirectSound....a very nice start... but .....first of all undersatnd Win32ASM a little ... make some Win32API GFX programs using 32 bits ASM to tune you up :)
Posted on 2001-10-22 13:15:47 by BogdanOntanu
While I agree with BogdanOntanu that asm is easier than C. (Asm is a WYTIWYG language, "What You Type Is What You Get" :). I must point out that there so many information resources in C/C++ that should be overlooked.

So to start in game programming. I recomend you to learn C/C++ then assembly. You will find that is very easy to translate from one language to another, but the real power of assembly is when you stop thinking in terms of C. (asm has a very large set of opcodes, thus is a more powerfull language than C).

Here a list of links to get more information on game development:

Gamedev Gamasutra game developer magazine OpenGL

If you still want to start with assembly scronty have some tutorials and includes at:
Posted on 2001-10-22 14:46:15 by dxantos
That sounds a bit strange dxantos, you agree with BogdanOntanu that asm is easier than C yet you recomend you to learn C/C++ then assembly.

I went from trying to write games in VB to trying to learn C++ to giving that up very quickly in favour of Asm. I won't say that the tranisition from VB to Asm was painless but I did jump straight into DirectX without understanding anything about Message Loops or Windows API.

You'd be suprised how quickly you learn when you're doing something you enjoy such as programming a game rather than boring dialog apps.

And you be suprised how much C/C++ you'll pick up along the way, in a few months you show know enough to translate most source code available on the net even if you've never written a line of C code in your life.
Posted on 2001-10-22 15:21:08 by Eóin
Yeah, Assembly actually is easier than C/C++ BUT, it's more complicated. It's easy because there are just a few registers, mnemonics and data types, but the hard part is to combine all this stuff into a working algorithm. That's why C/C++ is generaly easier *when you know it*. Of course C/C++ will be very hard for someone who does know almost nothing about C/C++.

Why does the world exclude Assembly if it is easier than C/C++? I think if the whole world uses C/C++ to write Games, Apps and big projects in general, then it must be truth that C/C++ is better for writing this kind of software. Or does you think that the whole world is stupid and knows nothing about software programming?

I stick with C/C++ and do the FPU calculations in Asm.
Posted on 2001-10-22 15:39:24 by eeprom
E?in: What I meant is that altough asm is easier to use that C, most of the sample code for game development in on C/C++.

eeprom: That was maybe true in the past, but masm syntax is very similar to C in various aspects. And also, the macro language tends to be more powerfull, (altough in C++ you get inline functions). The only advantage I see in C/C++ is that you get access to a very big database of free sourcode in any programing subject you wish. You also get the headers without need to translate them or wait for someone to do it.

By itself, C/C++ is not faster to develop in. (asm with macros has faster development time). Its not that you cannot do a big project in assembly. (For a big project, organization and pre-design is more important than the choice of language). Its that since most of the documentation, tools, and public domain sourcecode is on C/C++.
Posted on 2001-10-22 19:19:58 by dxantos

...altough asm is easier to use that C...

hmmm... how? Sure, the "components" asm is built up are simpler
than C. Each mnemonic is easier to understand, as it only does simple
stuff. However, this doesn't necessarily mean it's easier to use.
It's sorta the same as saying that it's easier to build a bridge with
lego then with duplo...

By itself, C/C++ is not faster to develop in.
(asm with macros has faster development time).

This might be true for the stuff that you typically see in win32asm.
Ie, simplistic stuff usually centered around API calls, with a few
manipulations here and there. But take some equations used in engineering
(about 3-4 A4 pages or more), and find a guy who is equivalently
proficient with asm and C, and make him write this stuff in floating point.
I wager that the C version is done first. Because float in asm *does*
take longer time to write.

And no, speed wasn't an issue in the case where we had to do this.
The calculations were done in less than one second on the target
machine... they're not realtime, and they usually take engineers a
couple of hours to do with their graph calculators.

And faster development time in general? I guess this depends on what
you do. Stuff where a single C line translates to a single asm line,
sure, asm is just as fast. Stuff where a single C line translates to
multiple asm lines... well.. I'd say C is faster there.

Take a look at "outvalue = flagset ? value1 : value2;". One way to do
it in asm (sorry if the logic is flawed, it's 02:39 and I'm off for bed)
would be:

mov eax, value2 ; default to the "false" statement
cmp [flagset], 0
je @skip
mov eax, value1 ; ok, so we guessed wrong
mov [outvalue], eax

Obviously, "value1" and "value2" can be more complex expressions, which
would lead to even more asm code. And don't tell me about "cmov", I know
about it, and compiler will utilize it if I tell them to.

Its not that you cannot do a big project in assembly.
(For a big project, organization and pre-design is more
important than the choice of language).

True. But it's easier to write dirty code in asm than in so many
other languages ;).
Posted on 2001-10-22 19:40:51 by f0dder
The main focus of this topic is a language for a newbie Game Programmer who does know almost nothing about DX. For this kind of people I just can recommend C/C++ or even Delphi because of the Compiler's Error Checking Power. Hey, for anyone to find an error in C/C++ source and the same error in Asm source I'm sure everybody would find the error in the C/C++ source first (at least for those who know C/C++).

Also, take a look at the first post of this topic:

Predator wrote:
I've written dos games in c...

He already knows C, so why should he mess up with Asm AND DX8? Let him learn DX8 trough C first, so he can learn it in peace without stressing himself about Asm. And later he will rewrite the DX8 exercises into Asm. Also, DX8 tutorials explain the stuff in C/C++ syntax. Ex: "The structure is composed of 3 floating point values.". How will he know what a float is in Asm? Will it be FLOAT, REAL4, REAL8??? And does he allready know how to do FPU calculations? Think of it, he already knows C.

Let him take the final decision. Maybe he will do fine in learning Asm and DX8 together, maybe not.

Predator: No matter what decision you take, I wish you good luck! :alright:
Posted on 2001-10-22 21:34:22 by eeprom
I think I probably don't know enough about asm yet to make a game and if I tried I'd get bored with it so I'm going to try and get a working demmo in c++ and then concentrate on how I would go about doing the same thing in asm that way I'll learn dx coding as well as get better at asm.
Posted on 2001-10-22 23:14:47 by predator
I dont think what your saying will help the person who asked in the first place. i know how to program in qbasic ( yes, i am new to programming), mainly because of the examples which were explained in lots of detail, so i didnt even have to learn dark basic. i know some stuff dos and languages based on dos and if i wanted to i could make any dos app because theres lots of infomation about it. there is no information about win32asm for ppl new to programming, only dos asm. I CAN FIND NOWHERE A DECENT TUTURIAL FOR C++/WIN32ASM. AS A RESULT I KNOW SHIT ALL ABOUT THEM. i thought converting a dos app to windows would be simple but everythings compleatly different apart from the registers and basic commands. PLZ could some1 write a tutorial explaining in lots of detail about how to create a window, how to open/same/manipulate files, how use direct x and open gl.



Ok what u said is useful plz say more
Posted on 2001-10-25 18:14:24 by UnregisteredBogie
Ummm, have you ever read iczelions tuts? They do exactly this...
explain everything in great detail. And exagone.cjb.net has a tutor
on win32asm as well (haven't read much of it, so I can't say how good
it is - but it looks promising).

Learn to look around, bogie ;)
Posted on 2001-10-25 21:06:27 by f0dder
As a newer rogrammer I think I can relate. I have taught myself C/C++ and asm. I found asm far easier to learn(the typecasting in C/C++ is bothersome char *, LPCSTR,...) but for DX I could only get it to work in C/C++. I tried first in asm but for some reason the libs and incs wouldn't work properly for me. Thus I went and learned C/C++. It was a quick download and the DX8 package for Dev-C++ works perfectly.
Posted on 2001-10-27 08:01:39 by brumanchu
thx fodder,
exagone.cjb.net tuts were just what i needed, also my bros learning delphi at university, is that a better language because he could teach me it properyly, also how would i make apps/dll's for games (like halflife) which are what i would like to do?

Also how do you open files in asm with dos, i would like to make some small games while im learning and i know how to make the stuff like graphics, models, textures, maps etc.. i dont know how to open them though?
Posted on 2001-10-28 15:12:44 by Unregisteredbogie
Well, delphi is okay if you concentrate more on the looks of the program
than the functionality (my opinion). Of course you can turn of the
RAD stuff and do "win32delphi", but then you loose the biggest point
of using delphi, namely the ease of the VCL. There's a few neat things
in delphi compared to eg C/C++, primarily the "unit" way of linking
multiple files together, rather than C's (and ASM's) a bit messy header/library
file approach. But I like the C language better, as it's a bit more
flexible (often interpreted by incompetent programmers as being

Delphi (well, pascal) is not a hard language to learn, and I suggest
that you learn it alongside assembler. Knowing pascal also makes
it easier to learn C/C++, which is probably the most important language
and has been for some time (again, my opinion).

If you're just after the money, sell your soul and code database
applications in visual basic ;).

As for dos... I'd urge you to stay away from it, or at least use a
32bit dos extender (wdosx, search for it on google, is pretty damn
neat, and even has a smallish implementation of some of the core
win32 functions, like CreateFile, ReadFile, and so on). Do NOT bother
with 16bit code for dos, and don't bother with anything where you
have to use "int xx" calls to get stuff done. WDOSX style coding
might actually be a little easier if you want to play with a little gfx
coding in 32bit asm, as it's easy to enter 320x200 (mode 13h),
and don't have to deal with eg DirectDraw.
Posted on 2001-10-28 23:30:42 by f0dder