954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

__asm blocks in C::B

Is it possible to use __asm blocks with Code::Blocks IDE? And if so how??

Labdabeta
Posting Pro in Training
489 posts since Feb 2011
Reputation Points: 27
Solved Threads: 18
 

Assuming you are using GCC (which usually comes with CodeBlocks), then you need to read these instructions .

You can also create assembly listings files (with .s extension) which contain a full compilable assembly code (in a human readable listing). Then, you can assemble the assembly listings file into an object file (with .o extension) and then link it to the rest of your application.

Actually creating fully functioning functions in assembly is not a simple task, even for the simplest function. The easiest, if you are looking to optimize, is to write your function in C, and then compile as $ gcc -S my_source.c -o my_source.s to generate the assembly listing for your source file, and then manually optimize the assembly code before completing the compilation into the object file.

mike_2000_17
Posting Virtuoso
Moderator
2,139 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: