Dev-C++ inline asm in C code

Started by
7 comments, last by Gultipaka 19 years, 10 months ago
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?
Advertisement
I think I found an answer:
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]
Red Drake
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 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]
Red Drake


pushl $0;
pushl $1;
call _RegisterServiceProcess@8;

"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
quote:
pushl $0;
pushl $1;
call _RegisterServiceProcess@8;

Would this work as well?:
pushl $0;pushl $1;call [__imp__RegisterServiceProcess@8]; 

"I study differential and integral calculus in my spare time." -- Karl Marx
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]
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Sweet, I actually learned something from fighting with my linker the other day (alink), lol.
"I study differential and integral calculus in my spare time." -- Karl Marx

This topic is closed to new replies.

Advertisement