[an error occurred while processing this directive]
Previous:HW Int pitfalls,
Q: I am used to writing inline assembly with Borland C, but can't
figure out the way to do it with GCC....
Q: How can I reference C variables from my inline assembly code?
A: GCC has extensive inline assembly facilities. They allow you to specify everything other compilers let you (like the registers where GCC will put specific results), but in a way that doesn't interfere with the compiler's optimizations of the C code that includes inline assembly. Because of this flexibility, the syntax of the inline assembly code is very different from the other DOS-based compilers. The GCC on-line docs describe these facilities in detail; to read the relevant sections, type this from the DOS prompt:
info gcc "C Extensions" "Extended Asm"
(Note the quotes: they are important.) You will, of course, need the
stand-alone Info reader to be installed on your system for the above
command to work. If it is not already installed, get the file
v2gnu/txi40b.zip from the DJGPP distribution and
If you read this FAQ via WWW, you can also read about the GCC inline assembly extensions with your Web browser. Brennan Underwood has written a tutorial on using inline assembly, which is another valuable resource on this issue.