Connecting Tech Pros Worldwide Forums | Help | Site Map

problems with interrupts and union regs

Newbie
 
Join Date: Jul 2006
Posts: 3
#1: Jul 17 '06
hi
i am having to problems:
interrupt decleration doesn`t compile:

void _interrupt _far terminal_isr()
.......
_dos_setvect(0xC,terminal_isr)

: error C4226: nonstandard extension used : '_far' is an obsolete keyword
: error C2061: syntax error : identifier 'terminal_isr'
: error C2059: syntax error : ';'
: error C2059: syntax error : ')'
: warning C4013: '_dos_setvect' undefined; assuming extern returning int

what can be the problem???
i am using microsoft visual c++ v.6 in windows xp/

about the union:

int IsMouse(void)
{
union REGS regs;

regs.x.ax = 0;
int86(MOUSE,&regs,&regs);
return(regs.x.ax);
}
error C2079: 'regs' uses undefined union 'REGS'
and I included dos.h

anyone plz???

Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,188
#2: Jul 17 '06

re: problems with interrupts and union regs


The clue is in the error message

: error C4226: nonstandard extension used : '_far' is an obsolete keyword

_far is a keyword that existed when DOS/Windows was a 16 bit environment which it isn't anymore.

Remove _far see what happens.
Newbie
 
Join Date: Jul 2006
Posts: 3
#3: Jul 18 '06

re: problems with interrupts and union regs


well... i removed the far. and its specific error gone. but the other three remain....
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,188
#4: Jul 18 '06

re: problems with interrupts and union regs


In that case I suggest that _interrupt, which is far from being a standard C/C++ keyword is also not recognised by your computer.

It also looks like _dos_setvect either does not exist on your platform or that you have not included the correct header files to use it.

You are on Windows XP and it seems farly unlikely that the Win32 compiler (VC++ v6) would still support the old dos system calls given that it doesn't really exist any more. For the same reason REGS doesn't exist anymore.

Have you looked at the contents of dos.h? Have you checked you platform documentation to see how it says you should do the thing you are trying to do.
Newbie
 
Join Date: Jul 2006
Posts: 3
#5: Jul 18 '06

re: problems with interrupts and union regs


first, 10x for your fast answer.
i searched in dos.h and there is no REGS there, and i would probavly delete this function.
about the interrupt - my platform is the regular pc with windows 98 or xp. so i dont understand which documentation you asked about.
and where i find it :
its should be easy but i dont find anywhere: how do i write interrupt function in c in visul++ at windows on regular pc.
Newbie
 
Join Date: Mar 2007
Posts: 1
#6: Mar 7 '07

re: problems with interrupts and union regs


Quote:

Originally Posted by Banfa

The clue is in the error message

: error C4226: nonstandard extension used : '_far' is an obsolete keyword

_far is a keyword that existed when DOS/Windows was a 16 bit environment which it isn't anymore.

Remove _far see what happens.

Como resolver o problema do mouse- ERRO apresentado:
storage size of 'regs' isn't known

Erro no REGS regs.


Desde já obrigado.
Reply