6 Years
Discussion Span
Last Post by NicAx64

There are more disadvantages than advantages to using inline assembly in c++ programs. I used to use inline assembly 20 years ago in old MS-DOS programs but that was because compilers were not very smart in those days. But today I wouldn't even consider it. Compilers are pretty damned good, and portability is a big issue now.


Of course In win32 or under linux I never used the inline assembly.

But there are some places that you should need to write assembly code.
In this semester I have a course unite called Operating system engineering.
and we study about Operating systesms. We are following the bran's kernel
development tutorial.

There are places like setting up the Global Descriptor table and the IDT interrupt
descriptor table where you need to write inline assembly.

and windows hal.dll (hardware abstraction layer) is written using assembly.hal.dll
is something which is 'processor specific'.

And some guys who learning DirectX and game development told me that they use
assembly for GPU optimization.There is something called CUDA ,I don't know anything
about it just only heard.But I know that's where programmers use Assembly language
in the industry.But that assembly language is completely different than the x86
assembly language.

And there are some places where we can't find a compiler or the compiler add
lots of overhead (big stacks and heaps) or too much abstraction. In the cases
like that it's necessary to use assembly language.Ex- Microcontrollers or small
embedded systems where you will find the device stack is only 16 bytes or
device heap is about 64 bytes.

In the world of x86 now ppl use "C" than assembly.
but read this too.
it's tldp archieve anyway,now that

Oh and the places like where we need to introduce new instructions, ex MMX instructions,
there also we can make use of the assembly.

Edited by NicAx64: n/a

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.