Jump to content
  • Advertisement
Sign in to follow this  
Br3nt0n

Assembly? C++?

This topic is 4930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is Assembly? What would you use Aseembly for and what would you use C++ for? Pros and Cons.

Share this post


Link to post
Share on other sites
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!