Assembly Language

Started by
7 comments, last by PsYcHoPrOg 24 years, 2 months ago
In a lot of the books I have read about game programming, assembly language is mentioned as a great help. However, the books don''t explain why or how. So I''m asking here, Why? How?
D:
Advertisement
short answear (im sick and tired of writing for the moment):
why: speed.
how: excluded in the short answear, some other day maybe.
why: assembly is closer to machine language than c/c++ or any other high level language. you can write the most optimized code the closer you get to machine level. dont even mess with it until you need to optimize certain functions for speed or dont mess with it at all.

how: figure it out when you need to know
Carl "trixter"[email=carl@trixoft.com]carl@trixoft.com[/email]http://www.trixoft.com
Thank you for responding, but I am aware of the reasons that you both have submitted. However, I raise another question... how do you include the assembly language in a game written using a C++ compiler?
D:
1) using inline assembler (most C/C++ support it)
2) compile the asm files into seperate objects and link it all together.

using the inline assembler is a trival task, usually its something like (in MSVC is it _exactly_ this):

_asm (asm in borland)
{
push eax
mov eax,ebx
...
}

Edited by - Staffan on 2/9/00 4:32:56 PM
Why: Its harder , more challenging , more control as to how you program is executed ( Can anyone say Re-entrant self self altering code ? )

How:Use Masm32 or Tasm
I was influenced by the Ghetto you ruined.
Ok, but where can I find an assembler?
D:
Read the "Win32 Assembly" guide on this site. It tells you exactly how to do it and theres a link to download MASM32.

http://www.gamedev.net/reference/programming/features/win32asm1/
As Staffan showed earlier, your C++ compiler is also an assembler. You''d rarely need to compile your assembly program seperate from your C++ program.

E:cb woof!
E:cb woof!

This topic is closed to new replies.

Advertisement