I just want to ask that can i execute assembly codes in code::block directly. I mean with out using _asm() function e.t.c.
any one have knowledge about it? and if so how to do this?
I just want to ask that can i execute assembly codes in code::block directly. I mean with out using _asm() function e.t.c.
any one have knowledge about it? and if so how to do this?
Code::Blocks is simply an IDE. Which compiler are you using with it?
gnu gcc
can I have an assembly compiler attached with it?
Don't you mean assembler?assembly compiler
In codeblocks, there is an option to make a makefile project.
Create the makefile manually, and open the assembly file in c::B .
Still, there won't be any benefit in that. A good text editor with an attached terminal works better in this case...Try Kate (*nix) or Notepad++ (win).
//btw..I don't know if Notepad++ has a terminal plugin.
Last edited by manasij7479; 07-19-2011 at 09:02 AM.
I'm not too familiar with the Windows port of GCC, but I'm sure it's near identical to the Linux one, at least for the "main" features. The compiler can recognize what type of file it has by the extension. A .c extension is for C source code. A .s file is for assembly. The Windows equivalent of the man page (i.e. documentation) should give you more specifics. AFAIK, the compiler works on translation units, which is basically a .c file after all the preprocessing (including the #inlucde files, replacing macros/constants, handling #if's, etc). With that being the case, you can't have a single file with mixed C code and assembly without using the _asm() function. You can however make a file that just contains assembly code, and give it a .s extension. GCC should be able to recognize it as an assembly file and only run the assembler on that file instead of the full C compiler. You should end up with a corresponding .o file that you can link into your final project.
Yes i meant assembler.Don't you mean assembler?
the file extension for assembly in windows is .asm . Yes as you say the Ide is able to recognize it as an assembly source code. but the problem is that the compiler is not able to find the required libraries to make an .obj or as you said .o file neither an .exe file.
Finding libraries has nothing to do with the compiling or assembly. It's part of the linking phase of the build process. You need to change your project settings to link the libraries you're using.