delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/03/09:34:09

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with gcc v2.953
Date: 3 Jan 2002 14:20:15 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 28
Message-ID: <a11pav$ovb$1@nets3.rz.RWTH-Aachen.DE>
References: <2hMY7.71$SI DOT 731 AT news DOT ono DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1010067615 25579 137.226.32.75 (3 Jan 2002 14:20:15 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 3 Jan 2002 14:20:15 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Francisco Pastor <Francisco DOT Pastor AT uv DOT es> wrote:

> selector) and after use the same offset ussing de %ds selector with the mov
> instruction. But in a interrupt handler %ss is different from %ds.

As far as I can see, the root of your problem is that you usually
can't write any interrupt handler in C, let alone C++, for exactly
this kind of reason: all code generated by the compiler will assume
SS=DS, which isn't true for interrupt handlers.  You need a wrapper
around the C(++) code written in assembly, or write the whole handler
in assembly right away.

> compiled with the file proof.cc have different result that if the name of
> the file is proof.c.

Note that inportb() is an "extern inline" function (in <pc.h>).  That
means most of its usages (if compiled with optimization turned on)
will not call the version found in libc.a at all.  One difference
between the various versions of compilers you're using (2.95.2
vs. 2.95.3, C++ vs. C) may very well be the decisions when to inline
and when not to.  Looking at GDB's "disassemble inportb" output won't
tell you anything about what actually happens: you have to disassemble
the code calling inportb(), instead.  Only if that does contain a call
to inportb(), the code of that routine matters.  

-- 
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