www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/07/07:55:38

Message-ID: <32FB23ED.73D@pobox.oleane.com>
Date: Fri, 07 Feb 1997 13:45:33 +0100
From: Francois Charton <deef AT pobox DOT oleane DOT com>
Organization: CCMSA
MIME-Version: 1.0
To: zager AT post DOT comstar DOT ru
CC: djgpp AT delorie DOT com
Subject: Re: How to dial with C-vars in .s modules
References: <32FB8923 DOT 6D21 AT post DOT comstar DOT ru>

Dim Zegebart wrote:
> 
> I have a .s function and some
> variables declared in .c module
> How can I use my C varr in .s module ?
> 

Let CFile.c be your C file : 
it contains something like
int yourvar;

To be able to use it in file Asmfile.S (note the uppercase S), you have 
to use a header file (.h), containig

extern int yourvar;

#include it in both CFile.c and Asmfile.S, and reference yourvar as

_yourvar in the asm code.

Francois

- Raw text -


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