www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - How to compile code with the "far" keyword?

reply Sushank <Sushank_member pathlink.com> writes:
Hi,
I am new to compiling in dos/windows/intel. I have some code which have a lot of
"far" keywords in them. How can i compile those with digital mars in win2k?
I have version 8.31 of digital mars.

Here's a typical error message that i get:

D:\uCOS\TANKCODE>dmc -c dbgmain.c
static void interrupt far (*OldTickISR)(void);
^
dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants have no
return value
OldTickISR = getvect(0x08);
^
dbgmain.c(175) : Error: undefined identifier 'OldTickISR'


Thanks in advance,
Sushank
Jan 02 2003
parent reply "Walter" <walter digitalmars.com> writes:
When the ^ is at the beginning of the line, it usually means the error is on
the previous line. Also, what memory model are you planning on using?

"Sushank" <Sushank_member pathlink.com> wrote in message
news:av13tq$ccf$1 digitaldaemon.com...
 Hi,
 I am new to compiling in dos/windows/intel. I have some code which have a

 "far" keywords in them. How can i compile those with digital mars in

 I have version 8.31 of digital mars.

 Here's a typical error message that i get:

 D:\uCOS\TANKCODE>dmc -c dbgmain.c
 static void interrupt far (*OldTickISR)(void);
 ^
 dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants

 return value
 OldTickISR = getvect(0x08);
 ^
 dbgmain.c(175) : Error: undefined identifier 'OldTickISR'


 Thanks in advance,
 Sushank

Jan 02 2003
parent reply sushank <sushank_member pathlink.com> writes:
The ^ actually points to the far keyword, sorry i got that wrong when i did
the copy paste and i didn't had a second look.
It looks like this:

static void interrupt far (*OldTickISR)(void);
^
dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants have no
return value
OldTickISR = getvect(0x08);
^
dbgmain.c(175) : Error: undefined identifier 'OldTickISR'           ^

I plan to use the small memory model.

regds,
sushank

In article <av20h8$rjq$2 digitaldaemon.com>, Walter says...
When the ^ is at the beginning of the line, it usually means the error is on
the previous line. Also, what memory model are you planning on using?

"Sushank" <Sushank_member pathlink.com> wrote in message
news:av13tq$ccf$1 digitaldaemon.com...
 Hi,
 I am new to compiling in dos/windows/intel. I have some code which have a

 "far" keywords in them. How can i compile those with digital mars in

 I have version 8.31 of digital mars.

 Here's a typical error message that i get:

 D:\uCOS\TANKCODE>dmc -c dbgmain.c
 static void interrupt far (*OldTickISR)(void);
 ^
 dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants

 return value
 OldTickISR = getvect(0x08);
 ^
 dbgmain.c(175) : Error: undefined identifier 'OldTickISR'


 Thanks in advance,
 Sushank


Jan 03 2003
parent reply sushank <sushank_member pathlink.com> writes:
It looks like text gets wrapped when i post my message. Sorry for that, i moved
the ^ sign to its proper places in my previous reply. Hope it works this time.

regds,
sushank

In article <av3i19$1oqi$1 digitaldaemon.com>, sushank says...
The ^ actually points to the far keyword, sorry i got that wrong when i did
the copy paste and i didn't had a second look.
It looks like this:

static void interrupt far (*OldTickISR)(void);
                        ^
dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants have no
return value
OldTickISR = getvect(0x08);
           ^
dbgmain.c(175) : Error: undefined identifier 'OldTickISR'           ^

I plan to use the small memory model.

regds,
sushank

In article <av20h8$rjq$2 digitaldaemon.com>, Walter says...
When the ^ is at the beginning of the line, it usually means the error is on
the previous line. Also, what memory model are you planning on using?

"Sushank" <Sushank_member pathlink.com> wrote in message
news:av13tq$ccf$1 digitaldaemon.com...
 Hi,
 I am new to compiling in dos/windows/intel. I have some code which have a

 "far" keywords in them. How can i compile those with digital mars in

 I have version 8.31 of digital mars.

 Here's a typical error message that i get:

 D:\uCOS\TANKCODE>dmc -c dbgmain.c
 static void interrupt far (*OldTickISR)(void);
 ^
 dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants

 return value
 OldTickISR = getvect(0x08);
 ^
 dbgmain.c(175) : Error: undefined identifier 'OldTickISR'


 Thanks in advance,
 Sushank



Jan 03 2003
parent reply "Walter" <walter digitalmars.com> writes:
Compile with the -ms flag to enable the far keyword. Also, use __far and
__interrupt instead (two _'s).

"sushank" <sushank_member pathlink.com> wrote in message
news:av3j0p$1p9h$1 digitaldaemon.com...
 It looks like text gets wrapped when i post my message. Sorry for that, i

 the ^ sign to its proper places in my previous reply. Hope it works this

 regds,
 sushank

 In article <av3i19$1oqi$1 digitaldaemon.com>, sushank says...
The ^ actually points to the far keyword, sorry i got that wrong when i


the copy paste and i didn't had a second look.
It looks like this:

static void interrupt far (*OldTickISR)(void);
                        ^
dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants


return value
OldTickISR = getvect(0x08);
           ^
dbgmain.c(175) : Error: undefined identifier 'OldTickISR'           ^

I plan to use the small memory model.

regds,
sushank

In article <av20h8$rjq$2 digitaldaemon.com>, Walter says...
When the ^ is at the beginning of the line, it usually means the error



the previous line. Also, what memory model are you planning on using?

"Sushank" <Sushank_member pathlink.com> wrote in message
news:av13tq$ccf$1 digitaldaemon.com...
 Hi,
 I am new to compiling in dos/windows/intel. I have some code which




lot of
 "far" keywords in them. How can i compile those with digital mars in

 I have version 8.31 of digital mars.

 Here's a typical error message that i get:

 D:\uCOS\TANKCODE>dmc -c dbgmain.c
 static void interrupt far (*OldTickISR)(void);
 ^
 dbgmain.c(151) : Error: voids have no value; ctors, dtors and




have no
 return value
 OldTickISR = getvect(0x08);
 ^
 dbgmain.c(175) : Error: undefined identifier 'OldTickISR'


 Thanks in advance,
 Sushank




Jan 03 2003
parent sushank <sushank_member pathlink.com> writes:
Thanks,
Compiling with -ms flag solved the problem.

cheers :)
Sushank

In article <av4p4k$2cie$1 digitaldaemon.com>, Walter says...
Compile with the -ms flag to enable the far keyword. Also, use __far and
__interrupt instead (two _'s).

"sushank" <sushank_member pathlink.com> wrote in message
news:av3j0p$1p9h$1 digitaldaemon.com...
 It looks like text gets wrapped when i post my message. Sorry for that, i

 the ^ sign to its proper places in my previous reply. Hope it works this

 regds,
 sushank

 In article <av3i19$1oqi$1 digitaldaemon.com>, sushank says...
The ^ actually points to the far keyword, sorry i got that wrong when i


the copy paste and i didn't had a second look.
It looks like this:

static void interrupt far (*OldTickISR)(void);
                        ^
dbgmain.c(151) : Error: voids have no value; ctors, dtors and invariants


return value
OldTickISR = getvect(0x08);
           ^
dbgmain.c(175) : Error: undefined identifier 'OldTickISR'           ^

I plan to use the small memory model.

regds,
sushank

In article <av20h8$rjq$2 digitaldaemon.com>, Walter says...
When the ^ is at the beginning of the line, it usually means the error



the previous line. Also, what memory model are you planning on using?

"Sushank" <Sushank_member pathlink.com> wrote in message
news:av13tq$ccf$1 digitaldaemon.com...
 Hi,
 I am new to compiling in dos/windows/intel. I have some code which




lot of
 "far" keywords in them. How can i compile those with digital mars in

 I have version 8.31 of digital mars.

 Here's a typical error message that i get:

 D:\uCOS\TANKCODE>dmc -c dbgmain.c
 static void interrupt far (*OldTickISR)(void);
 ^
 dbgmain.c(151) : Error: voids have no value; ctors, dtors and




have no
 return value
 OldTickISR = getvect(0x08);
 ^
 dbgmain.c(175) : Error: undefined identifier 'OldTickISR'


 Thanks in advance,
 Sushank





Jan 08 2003