Click to See Complete Forum and Search --> : inline assembler in gcc


DrPhobeus
10-18-2001, 04:16 AM
Hi,

I have been trying to create a macro which passes it's paramters to an assembler instruction, but can't figure out how it is done. To give you an idea what I am trying to accomplish -

#define ljmp(x, y) __asm__ ("ljmp x, y")

how do I get the macro params into the assembler statement?

Also, does anyone know of any good references for the inline assembler, I am going to be using it a lot, and only have a sparse knowledge of it.

Cheers,
DrP.

Qubit
10-18-2001, 08:03 AM
GCC is very, very picky about inline assembly (You thought that as-style assembly was hard? You obviously haven't tried inline assembly with GCC!), but there are some good tutorials on GCC inline assembly. Do a google search on "GCC inline assembly" and check out the first 2 results.