c++ - DM 8.23
- Roland <rv ronetech.com> Nov 15 2001
- Roland <rv ronetech.com> Nov 15 2001
- "Walter" <walter digitalmars.com> Nov 15 2001
- Roland <rv ronetech.com> Nov 16 2001
- Roland <rv ronetech.com> Nov 16 2001
- "Walter" <walter digitalmars.com> Nov 16 2001
- "John Culver" <jculver btinternet.com> Nov 16 2001
- "John Culver" <jculver btinternet.com> Nov 16 2001
- "Laurentiu Pancescu" <plaur crosswinds.net> Nov 15 2001
- "Walter" <walter digitalmars.com> Nov 15 2001
- Roland <rv ronetech.com> Nov 16 2001
trying DM 8.23 compiler in DOSX model.
i only replaced bin\SCPPN.EXE and bin\SCPPND.EXE
i had
typedef enum boolean {false,true};
in a header.
it does not compile any more: "identifier expected"
not a big problem, just for information
Roland
Nov 15 2001
Roland a écrit :trying DM 8.23 compiler in DOSX model. i only replaced bin\SCPPN.EXE and bin\SCPPND.EXE
- i mean bin\SCPPND.DLL - sorry outpw, inpw are still 32 bit contrary to what compiler.htm says Regards Roland
Nov 15 2001
"Roland" <rv ronetech.com> wrote in message news:3BF39B52.6D08BC5F ronetech.com...- sorry outpw, inpw are still 32 bit contrary to what compiler.htm says
I thought I tested & verified it. Could you post an example? -Walter
Nov 15 2001
Walter a écrit :"Roland" <rv ronetech.com> wrote in message news:3BF39B52.6D08BC5F ronetech.com...- sorry outpw, inpw are still 32 bit contrary to what compiler.htm says
I thought I tested & verified it. Could you post an example? -Walter
little function int _testbug() { int i; i1 = inpw(0x03ce); //16 bit outpw(0x03ce,i); //16 bit return i; } unassembles ?_testbug YAHXZ: mov EDX,03CEh in EAX,DX ;32 bit ! mov ECX,EAX mov EAX,ECX out DX,EAX ;32 bit ! mov EAX,ECX ret Regard Roland
Nov 16 2001
Roland a écrit :int _testbug() { int i; i1 = inpw(0x03ce); //16 bit outpw(0x03ce,i); //16 bit return i; } unassembles ?_testbug YAHXZ: mov EDX,03CEh in EAX,DX ;32 bit ! mov ECX,EAX mov EAX,ECX out DX,EAX ;32 bit ! mov EAX,ECX ret Regard Roland
i forgot: model is DOSX (-mx), i use the idde Roland
Nov 16 2001
ok, I'll check it out. -Walter "Roland" <rv ronetech.com> wrote in message news:3BF4DC3B.3661472C ronetech.com...Roland a écrit :int _testbug() { int i; i1 = inpw(0x03ce); file://16 bit outpw(0x03ce,i); file://16 bit return i; } unassembles ?_testbug YAHXZ: mov EDX,03CEh in EAX,DX ;32 bit ! mov ECX,EAX mov EAX,ECX out DX,EAX ;32 bit ! mov EAX,ECX ret Regard Roland
i forgot: model is DOSX (-mx), i use the idde Roland
Nov 16 2001
Hi,
I can generate this too, but only by using a conio.h to provide the
prototypes
for inp*/outp*:
====== CODE GENERATES inpw/outpw as 16 bit
#include <stdint.h>
// #include <dos.h>
#include <conio.h>
const baseAddress = 0x300;
int main (int argc, char * argv[])
{
uint8_t i8;
uint16_t i16;
uint32_t i32;
// Generate 3 inputs
i8 = inp (baseAddress);
i16 = inpw(baseAddress);
i32 = inpl(baseAddress);
// generate 3 outputs
outp (baseAddress, i8);
outpw(baseAddress, i16);
outpl(baseAddress, i32);
return 0;
}
====== END of CODE GENERATES inpw/outpw as 16 bit
This variant below (the one I've used) works 100%, fully inline and
_inpw/_outpw are 16
bit with -mx.
The changes are the _ before the inp* and outp* and the use of dos.h rather than
conio.h :
====== CODE that works
#include <stdint.h>
#include <dos.h>
// #include <conio.h>
const baseAddress = 0x300;
int main (int argc, char * argv[])
{
uint8_t i8;
uint16_t i16;
uint32_t i32;
// Generate 3 inputs
i8 = _inp (baseAddress);
i16 = _inpw(baseAddress);
i32 = _inpl(baseAddress);
// generate 3 outputs
_outp (baseAddress, i8);
_outpw(baseAddress, i16);
_outpl(baseAddress, i32);
return 0;
}
====== END of CODE that works
======== build lines ...
sc -mx -c -C ioTest.Cpp
Obj2Asm ioTest.Obj >Fixed.Dmp
========
The problem appears to be the conio.h on my system, The 'offending' conio.h on
my
system is :
CONIO H 8,091 03-17-01 12:15a CONIO.H
I've not checked the exact nature of the inp/outp prototypes in there, but I
assume
that they are substantially different to the updated ones in the dos.h that
appeared
with the 8.23 Beta.
John Culver
"Roland" <rv ronetech.com> wrote in message
news:3BF4DB59.9B791A69 ronetech.com...
Walter a écrit :
"Roland" <rv ronetech.com> wrote in message
news:3BF39B52.6D08BC5F ronetech.com...
- sorry outpw, inpw are still 32 bit contrary to what compiler.htm says
I thought I tested & verified it. Could you post an example? -Walter
little function
int _testbug() {
int i;
i1 = inpw(0x03ce); //16 bit
outpw(0x03ce,i); //16 bit
return i;
}
unassembles
?_testbug YAHXZ:
mov EDX,03CEh
in EAX,DX ;32 bit !
mov ECX,EAX
mov EAX,ECX
out DX,EAX ;32 bit !
mov EAX,ECX
ret
Regard
Roland
Nov 16 2001
Hi.
I've just patched my DM up to the current code set cd81d, then cd823, and
the
incorrect code generation with conio.h remains.
John Culver
Nov 16 2001
"Roland" <rv ronetech.com> wrote in message news:3BF396E2.CB83AF95 ronetech.com...trying DM 8.23 compiler in DOSX model. i only replaced bin\SCPPN.EXE and bin\SCPPND.EXE i had typedef enum boolean {false,true}; in a header. it does not compile any more: "identifier expected"
It should work, and it does for me (I also used 8.23, to be sure). In C, not in C++ (true and false are keywords in ISO-C++, they are the only acceptable values for the bool type). I wonder why this worked until now, -Ab is default for some time (8.20, at least, if not sooner). Probably your header is included from a C++ file, and the compiler correctly complains about misuse of a keyword instead of an (expected) identifier. Regards, Laurentiu
Nov 15 2001
This compiles correctly with C, and fails correctly with C++ (since false and true are now C++ keywords). -Walter "Roland" <rv ronetech.com> wrote in message news:3BF396E2.CB83AF95 ronetech.com...trying DM 8.23 compiler in DOSX model. i only replaced bin\SCPPN.EXE and bin\SCPPND.EXE i had typedef enum boolean {false,true}; in a header. it does not compile any more: "identifier expected" not a big problem, just for information Roland
Nov 15 2001
okay, thanks Roland Walter a écrit :This compiles correctly with C, and fails correctly with C++ (since false and true are now C++ keywords). -Walter "Roland" <rv ronetech.com> wrote in message news:3BF396E2.CB83AF95 ronetech.com...trying DM 8.23 compiler in DOSX model. i only replaced bin\SCPPN.EXE and bin\SCPPND.EXE i had typedef enum boolean {false,true}; in a header. it does not compile any more: "identifier expected" not a big problem, just for information Roland
Nov 16 2001









"Walter" <walter digitalmars.com> 