X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker 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: 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 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 ). 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.