C and Assembler

Hi there people, I’m a new OpenGL User, and I would like to know what are the benefices using C + Assembly…

I have a few experience in Assembler for the old MS-DOS (16-bits assembly).

At that time, I used to use Assembly to make video access higher.

But, I don’t know why we use Assembly nowadays…

I think it’s not to access the video-card, because today, we have a lot of different video-cards, and It would be boring to write the code for all them (to be compatible).

So, Why we use Assembly nowadays?

Thank you very mutch guys!!! :slight_smile:

Hi !

I don’t think there are that much assembler code in todays OpenGL applications, even though you could use it to make some things faster, vector and matrix math could be speeded up some, you could also use MMX or some other form of SIMD in assembler to improve things.

But as I said, I don’t think there is that much assembler in most applications today.

One reason is that a lot of applications (including games) must be able to run on different platforms and we get new CPU’s all the time, and assembler code must be optimized for a specific CPU to make any bif difference.

Mikael

Hi there

I use Assemble and OpenGL togheter ,and its working. What i want to say is that Assemble gives me more possibilites to write own routins to use, for example own .dll files that i think is more fast and safer than other (already programed fils does). But its not easy, Beacuse you have to start from scratch.
But to integrate OpenGL ,Win32 and Assemble is easy (sometimes more easy than it is with C/C++).

hope you find a way ,good luck

Assembly IT’S used a lot in nowadays apps (I’m talking about competitive apps).

just do a test, in VC++ write :

int a = (int)1.5f;

and see what machine code generates the compiler.
Of course if you don’t want all that garbage in your code is better to write your own ceil and floor routines.
Also my math classes (vectors, matrices,intersections) had a speed up of 50% after rewriting them using MMX.

Believe me it’s quite usefull to write code in assembly (if you can how to write it), the compiler usually does a good job, but it always need to be generic, so not optimized for a certain situation.

just my 2 cents.

rIO.sK http://www.spinningkids.org

Hi !

Not sure how you could optimize it more:

The code int a = (int) 1.5; is compiled as “push 1”, is there a faster way maybe…

Mikael

Sorry, there should have been a smiley in the message above, it was lost somewhere on the way, just wanted to point that out.

Mikael

using ASM in C(++) to speed-up your code depends ALOT on your compiler. There’s no problem speeding up some code compiled with hm… borland visula C++ 2.0 but trying to beat MS VisualStudia.NET is almost useles

Thank You very mutch guys!!! You helped me a lot!!!

:slight_smile:

After this, I think I’ll try to make some codes in Assembler…

Hehe, but I don’t know how to start. Can you recommend me some sites or tutors?

I have few experience with 16-bit Assembly, Anything you can give will help-me !!!

Thanks again! :slight_smile:

perhaps romka’s site try (romka opengl) in google