www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/01/08:20:38

Date: Mon, 1 Feb 1999 14:17:48 +0100
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <199902011317.OAA10989@acp3bf.physik.rwth-aachen.de>
To: djgpp AT delorie DOT com
Subject: Re: Accessing Constants in Assembly Code
Newsgroups: comp.os.msdos.djgpp
Organization: RWTH Aachen, III. physikalisches Institut B
X-Newsreader: TIN [version 1.2 PL2]
Reply-To: djgpp AT delorie DOT com

In article <000801be4d5f$66931660$9fbc98ce AT waldroni> you wrote:

> gxx -S mode13.cc
[...]
> Here's the block from mode13.s that appears to define VideoRAM:

> LFE3:
> lcomm _VideoRAM,4
[...]
>     call ___dpmi_segment_to_descriptor
>     movl %eax,_VideoRAM
>     leave

Maybe the problem is that _VideoRAM is not flagged 'global' (i.e. there
is not line 'globl _VideoRAM' in mode13.s, as you show it)?
If my little bit of assembly knowledge didn't deceive me, this means that
VideoRAM is not visible outside of mode13.cc.

I think you'll have to add the 'extern' keyword to your definition of
VideoRAM in mode13.cc. Reading up in the draft C++ language standard
supports this view (From section 3.5, 'Program and linkage'):

---- clip -------
3 A name having namespace scope (_basic.scope.namespace_)  has  internal
  linkage if it is the name of

  --an  object, reference, function or function template that is explic-
    itly declared static or,

  --an object or reference that is explicitly declared const and neither
    explicitly  declared extern nor previously declared to have external
    linkage; or

  --the name of a data member of an anonymous union.
----- clip ----

--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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