Dev-C++ inline asm in C code
I have such code in Intel.
Frankly I don''t really know asm well. Could someone transform this Intel code into AT&T.
asm{
push 0
push 1
call RegisterServiceProcess
}
or how can I solve this in other way?
I think I found an answer:
asm("push 0; push 1; call _RegisterServiceProcess");
but now I get linker error:
undefined reference to ''RegisterServiceProcess''
asm("push 0; push 1; call _RegisterServiceProcess");
but now I get linker error:
undefined reference to ''RegisterServiceProcess''
Write in
asm {
.intel_syntax noprefix
... code
.ATT_syntax
}
This way you will get intel code translated by compiler
P.S.
Sory about gramatial errors
[edited by - Red Drake on May 27, 2004 8:37:37 AM]
asm {
.intel_syntax noprefix
... code
.ATT_syntax
}
This way you will get intel code translated by compiler
P.S.
Sory about gramatial errors
[edited by - Red Drake on May 27, 2004 8:37:37 AM]
It doesn''t like it.
I get "parse error before token {" - it doesn''t understand such code asm {.., and neither does this one: asm (.intel_syntax noprefix...
I get "parse error before token {" - it doesn''t understand such code asm {.., and neither does this one: asm (.intel_syntax noprefix...
I yust rememberd that gcc/g++ dows not "see private declared objects".
I don't know anything specific about this buth I asume that your code works in VC++.
Hope this helps
If not see docs on GCC.
[edited by - Red Drake on May 27, 2004 1:44:49 PM]
[edited by - Red Drake on May 27, 2004 1:45:20 PM]
I don't know anything specific about this buth I asume that your code works in VC++.
Hope this helps
If not see docs on GCC.
[edited by - Red Drake on May 27, 2004 1:44:49 PM]
[edited by - Red Drake on May 27, 2004 1:45:20 PM]
quote:
pushl $0;
pushl $1;
call _RegisterServiceProcess@8;
Would this work as well?:
pushl $0;pushl $1;call [__imp__RegisterServiceProcess@8];
quote:Original post by temp_ie_cant_thinkof_name
Would this work as well?:pushl $0;pushl $1;call [__imp__RegisterServiceProcess@8];
Probably. It depends on how the compiler deals with imports and how it mangles names.
// edit: compiler in the sense of compiler + linker
[edited by - lessbread on May 29, 2004 9:33:31 PM]
Sweet, I actually learned something from fighting with my linker the other day (alink), lol.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement