Archived

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

asm in gcc

This topic is 5887 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

How can I include asm code into a c/cpp-file? I see a lot of stuff compiled with msvc with asm included into the c/cpp-files and just can''t compile them how can I do that? Or do I have to make a .s-file an link it? How can I then declare a function to call from the c-prog? (I haven''t been using asm for 2 years) - By the way, are there any good tuts on the net to learn assembler? I need the kind of assembler with the operands xchanged, because I''m using the gnu assembler. Any help would be appreciated, Gahre

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
gcc doesn''t use the same asm syntax as most others. The assemblers for VC and BCB use an intel syntax (MASM, TASM, and even the free assemblers like NASM all use similar syntax); gcc uses an AT&T made syntax that more closely resembles what was used on unix mainframes (I think it''s called GAS).

Take a look at the asm help topics in the g++ hlp file or look at the gasp help file (gasp is an assembler for the GAS syntax).

According ot the folks on alt.lang.asm, theh GAS syntax is not very user friendly.

Share this post


Link to post
Share on other sites