Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>When you use a C++ compiler, it will add extra code to your program that is not in <code>int main()</code>. If you ever decompile a simple hello world program, you will notice it begins execution far before <code>int main()</code>, calling a few functions such as <code>_set_app_type</code> and <code>_getmainargs</code> and then eventually calls your <code>int main()</code>. The most interesting thing to you would probably be the call to <code>_getmainargs</code> as it gets the command line arguments for your program. If you were to compile your assembly with an assembler such as NASM, FASM or even GAS, it would not make calls to <code>_getmainargs</code> and others so you as a programmer would have to implement your own way to get command line arguments which can be tricky for beginners.</p> <p>As long as you specify your <code>__asm</code> with the <code>volatile</code> keyword, the compiler should not tinker with your assembly code and it will run (that specific code) as if it was an " Assembler program".</p> <p>If you are looking for an IDE for assembly, I can tell you I have been down the same path. I use FASM which is a great little IDE but there are plugins for Eclipse and even Visual Studio though I can't say I have had good experiences with them.</p> <p>Edit: I'd like to add that if you are learning assembly, you are probably better off learning it with an assembler. The common uses of assembly are used when C++ or a higher language cannot be, therefore if you become dependent on a C++ compiler and inline assembly syntax it could likely cause confusion when you try to write raw assembly.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload