Sign in to follow this  
Br3nt0n

Assembly? C++?

Recommended Posts

Catafriggm    296
Assembly is a human-readable form of machine code. It's processor-specific. C++ is a high-level language that is not processor-specific. C++ is much easier to write complex programs in, but there are some things you can't do with it (such as these atomic variable access functions I'm writing), which can only be done in assembly. It's also usually argued that assembly is faster than C/C++, but you have to be very knowledgeable about how the processor works to beat modern optimizing compilers. Not to mention that generally all processors work differently, as far as what is fastest. What blazes on a Pentium may crawl on a Pentium IV (I can think of one specific instance where this would be the case, off the top of my head).

In summary, use C++ whenever you can, and use assembly when you have to.

Share this post


Link to post
Share on other sites
Nemesis2k2    1045
Expanding on that, assembly is still occasionally used in select areas of an application, where speed is critical. There are some instruction sets that compilers for high-level languages find it hard to leverage effectively (eg, SSE), and writing code directly in assembly to make use of these instructions can provide a significant speed boost. Math libraries still commonly make use of assembly for example.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this