Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Gultipaka

Dev-C++ inline asm in C code

This topic is 5139 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
I think I found an answer:
asm("push 0; push 1; call _RegisterServiceProcess");

but now I get linker error:
undefined reference to ''RegisterServiceProcess''

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!