www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/17/23:57:32

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Some Inline ASM questions
Date: Thu, 17 Oct 1996 22:26:19 -0700
Organization: Three pounds of chaos and a pinch of salt
Lines: 29
Message-ID: <326714FB.6C7B@cs.com>
References: <326651D4 DOT 7250 AT dmu DOT ac DOT uk>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp104.cs.com
Mime-Version: 1.0
To: khcm6sh AT dmu DOT ac DOT uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019