Mail Archives: djgpp/1996/10/17/23:57:32
Simon Hammett wrote:
>
> Hi all,
> After trawling throught the FAQ, the GNU C Preprocessor info, and the
> GCC info I've decided to give up and ask for a hand...
>
> in a simple GFX library I'm writting, I want to be able to change what
> Resolution it works in by chaning a #define statement. This obviously
> makes changing the code much easier. But I can't find anyway of using a
> defined macro in a inline ASM("") statement ie:
> [snip]
> I'd like to know how to use the #define's in the assembly code.
You have to tell gcc to preprocess your asm file by naming it with a
'.S' extension, as opposed to '.s'. For example, "gcc foo.s" is
different than "gcc foo.S", even though the case doesn't matter to DOS.
The gcc docs cover this under Invoking GCC, Overall Options.
> Also, is it possible to pass values to a inline asm, ie write a function
> entirly in ASM with out having to use global varibles.
Use the Extended ASM feature of gas, documented in the DJGPP docs.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -