hello,
first of all, thanks for the great work put into codelite
it's really a superb IDE as I've seen so far.
my question is can codelite do inline asm ?
inline asm ?
-
- CodeLite Curious
- Posts: 2
- Joined: Mon Oct 12, 2009 12:50 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: inline asm ?
With the upgrade to the latest scintilla editing component, I believe we can achieve 'read-only-inline-asm' using the 'annotations'
See here how they used for compiler/error warning:
http://codelite.org/ComingRelease/NewFeatures
With the correct settings (i.e. using proper background colour / font / forgound color) we can simulate an inline asm, however there will be some limitations:
- the code is not editable
So it will be mainly for debugging purpose (similar to what VS does today)
My Question:
- Do you need to be able to edit C/C++/asm on the same source file?, if this is the case, then I am afraid that atm, this is not feasible. For 'read only' it is very much possible using the method I described above
Eran
See here how they used for compiler/error warning:
http://codelite.org/ComingRelease/NewFeatures
With the correct settings (i.e. using proper background colour / font / forgound color) we can simulate an inline asm, however there will be some limitations:
- the code is not editable
So it will be mainly for debugging purpose (similar to what VS does today)
My Question:
- Do you need to be able to edit C/C++/asm on the same source file?, if this is the case, then I am afraid that atm, this is not feasible. For 'read only' it is very much possible using the method I described above
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 2
- Joined: Mon Oct 12, 2009 12:50 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: inline asm ?
thanks for the quick reply !
yes, I need to edit C++/asm on the same source file.
actually I'm trying to recompile a project that's been done on VC with inline assembly.
it has stuff like this :
http://www.ibiblio.org/gferg/ldp/GCC-In ... TO.html#s2
GCC inline assembly looks something like this
what do you think ? could it be posible ?
yes, I need to edit C++/asm on the same source file.
actually I'm trying to recompile a project that's been done on VC with inline assembly.
it has stuff like this :
now I've checked and GCC support of inline assembly is very different. MS uses the Intel convention while GCC uses AT&T style._asm
{
mov esp, exceptionstack
}
#ifdef PREFETCH
_asm
{
pushad
mov edx, dword ptr [pc]
call prefetch_fillASM
popad
jmp dword ptr [exceptionbackdooraddress]
}
#endif
http://www.ibiblio.org/gferg/ldp/GCC-In ... TO.html#s2
GCC inline assembly looks something like this
well I can change the intel asm in my source to AT&T style but of course without codelite somehow passing it to GCC it won't be much good.__asm__ ("movl %eax, %ebx\n\t"
"movl $56, %esi\n\t"
"movl %ecx, $label(%edx,%ebx,$4)\n\t"
"movb %ah, (%ebx)");
what do you think ? could it be posible ?
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: inline asm ?
codelite is just a "pipe" to GCC, it generates a makefile and simply runs it.
So all you need to understand is what are the flags that you need.
In most cases, this "template" is good for compilation of code which includes inline assembly:
To translate it into the codelite language:
In the project settings, (right click on your project and select settings), in the 'General' tab make sure that the g++ or gcc compilers are selected.
Next, in the 'Compiler' add this line (if not already there):
Note that I am using semi-colon to separate the different flags, since this is the codelite way of doing it.
Other than that codelite should be able to generate a makefile with the correct compilation line to compile your code.
EDIT:
here is a good link:
http://tldp.org/HOWTO/Assembly-HOWTO/gcc.html
Eran
So all you need to understand is what are the flags that you need.
In most cases, this "template" is good for compilation of code which includes inline assembly:
Code: Select all
gcc -O2 -fomit-frame-pointer -W -Wall
In the project settings, (right click on your project and select settings), in the 'General' tab make sure that the g++ or gcc compilers are selected.
Next, in the 'Compiler' add this line (if not already there):
Code: Select all
-O2;-fomit-frame-pointer;-W;-Wall
Other than that codelite should be able to generate a makefile with the correct compilation line to compile your code.
EDIT:
here is a good link:
http://tldp.org/HOWTO/Assembly-HOWTO/gcc.html
Eran
Make sure you have read the HOW TO POST thread