Jump to content
  • Advertisement
Sign in to follow this  
Kaycon11

Question about assembly programming

This topic is 3720 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

Correct me if I'm wrong, but with assembly, you can just type it into any compiler such as one for C++ or C#, right?

Share this post


Link to post
Share on other sites
Advertisement
No. Assembly language has a specialized compiler just like any other language, although compilers for Assembly are more often referred to as assemblers.

A popular choice is NASM.

Share this post


Link to post
Share on other sites
Some C/C++ compilers accept inline assembly, but the syntax varies from compiler to compiler.

Share this post


Link to post
Share on other sites
Firstly a small correction: you don't type into your compiler, you type into a text-editor (which is probably part of an IDE, or Integrated Development Environment). Your compiler may in some cases (it varies from language to language and even for different compilers for the same language) generate assembly from a higher level language (such as C) before passing it on to an assembler to generate machine-code/an executable. If you'd like to learn a bit more about this process, have a search for resources on "build process" or "program compilation/assembly".

Now, what you're talking about is generally referred to as inline assembly, the idea being that you'll probably write most of your program in your higher level language (C, C++, whatever) of choice but have a few sections written in assembly for speed or efficiency reasons (or perhaps just because you're trying it out for educational purposes). This is supported differently by different compilers (and isn't always possible), and you'll need to check the documentation of whatever you're using to see if and how it's supported. If you tell us which tool(s) you're using we may be able to offer more advice.


If you just want to write programs using pure assembly you could try a tool such as MASM or NASM.

Does that help?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!