Skip to contentSkip to conversation

Using gcc to compiler assembly

DISCUSSION Joseph D. Wagner 1 participant 1 message Nov 3, 2002

lore
Share & tools
lore
#0 lore raw

What you've got isn't pure Assembly; it's some strange jumble of C and Assembly.

To include Assembly in C, use
asm {
; // Assembly Code Here
}

or

__asm {
; // Assembly Code Here
}

depending on the compiler.

To program in pure Assembly, ditch GCC. Go with NASM.
http://sourceforge.net/projects/nasm

And based on your lack of distinction between C and Assembly, I also recommend:
http://www.amazon.com/exec/obidos/tg/detail/-/0130910139/

Joseph Wagner

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andrew Haydon
Sent: Saturday, November 02, 2002 5:09 PM
To: [email protected]
Subject: Using gcc to compiler assembly

Gurus,

How to use GCC compiling assembly codes? I attached my example code and tried gcc -c -o foo.o foo.S. This line "typedef foo_bar_t int;" choked. I
read the Makefiles for linux kernel and still could not understand how these
assebmly codes were compiled by GCC.

Thanks in advance,

Andrew

_________________________________________________________________
Unlimited Internet access -- and 2 months free!  Try MSN.
http://resourcecenter.msn.com/access/plans/2monthsfree.asp

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html