Hello everyone. I have just started using asembly and at the moment, I am at whatever step is before newbie. Ok, on to my questions...does anyone have an opinion as to weather there is a large advantage to using full asm with DX? Would it be alright to code all of the COM stuff with C++ and then use inline asm for the actual game logic and data manipulation? C++ isn't a bad word in here, is it? ;) Also, I read that the art of asembly tutorial is for 16 bit asm. If I use the tutorial with MASM32, will things work correctly, or are there changes that need to be made? I seem to remember reading that there are no segments in win32 asm (or they at least work differently), but maybe my mind is just making it up. Anyway, thanks for any help.
Posted on 2001-09-22 02:52:38 by AlexEiffel
I am almost as new around here as yourself, and I will refer you to another source to answer a couple of questions.

segments - Iczelion's Tutorials [ tut#1 ] explains this fully

c++ a bad word? - not really i guess :tongue: but check the "Crusades" section of the board.

If I remember right "The Art of Assembly Language," does not use MASM syntax. It uses HLA [ High Level Assembler ] to teach the concepts of asm.

I'm new around here but have found I can learn an unreal number of new things every day just reading the posts here, downloading and forcing my way through their examples, and drinking vast quantities of caffeine enhanced liquids.
Posted on 2001-09-22 15:03:44 by Mark
Hi Alex !

If you have the time to develope a directx-application in asm then some reasons to do this are the size of code, the cleaness of code (Try to follow the code of a dissambled c++ subroutine ;) ), and the full access on everything you do in your code.

Well the main disadvantage (for beginners) is that, that you don't have good solutions in local-memory-handling (the heap isn't as good as it used to get fragmented by heavy use of alloc and release. Even it is very slow ... e.g. the memory-handler of delphi is better !), no easy stuff for loading and saving files (except direct api-calls, but you need some more than one) and some other stuff like exception-handling, io-error-checking, ...

So at first you have to make your own implementations of these functions.

Mixing both is a good solution in doing fast applications in a shorter time.

Well handmade-assembly code needs not to be faster than compiled one ! The difficulty is to order the data and code by your own for a fast way of handling and to use as many processor-optimizations as you are able to (and this can be very tricky ! )
But no other language can beat the feeling having manged a nice programm full working in assembly with a size of a tenth of a HLL-version !
(I managed a full moving directx8-3d-star sample with music in 12 k without the datafiles and I feel great every time I look at this !)

Greetings, CALEB
Posted on 2001-09-22 15:40:01 by Caleb
Hey guys, I just wanted to say thanks for the information. I have actually downloaded those tutorials and started working through them. It's nice at least being able to see some thing simple like a messagebox instead of just saysing "wow...I moved 3 into the BX register....great..." I have also taken a look at the web pages of a few of the members that have posted, and I believe that after I become a bit more familiar with asm, their tutorials will be a great help. Thanks again:grin:
Posted on 2001-09-22 18:53:15 by AlexEiffel
We did it all in ASM (Hostile Encounter) so you can do it also :)

C++ is not a bad word, just a bad programming language...

Really, leaving crusades away, we never needed c/c++ in our game, doing it in ASm is fun and fast, not to mention we have the full power under our finger tips...

Please undersatd that i am a professional C++ coder also (as i have my own software company and i actually get money from writeing C++ applications ... yeah and VFox also) I loose a lot of time in casting in C++ and believe me i am never so happy as i am in asm ... the only problem are my clients that do not get it and keep asking for C++ code ;)

In asm i have no problems manipulateing the memory and variables just the way i want it and i do not have to do any casting! There is more freedom in ASM then in C++...but all this comes at some cost: you need knowledge and you will loose some portability (that is why High Level languages still exist....) but today 90% of machines are Intel(c) anyway...so no big loos, also recoding to other microprocessors is not that hard as it looks...

The whole COM stuff in ASM is just those instructions:


mov eax,[lpDDSBack] ; the pointer to the object instance
push eax ; param hidden by C++

mov eax,[eax] ; get vtable address
call [eax + DDS_Blt] ; call the Blt method


as you can see no big deal...maybe this all COMish stuff means something in C++ but to ASM is just the last 2 instructions ...
Posted on 2001-09-24 16:42:01 by BogdanOntanu