473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

problems with interrupts and union regs

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???
Jul 17 '06 #1
5 9621
Banfa
9,065 Expert Mod 8TB
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.
Jul 17 '06 #2
well... i removed the far. and its specific error gone. but the other three remain....
Jul 18 '06 #3
Banfa
9,065 Expert Mod 8TB
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.
Jul 18 '06 #4
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.
Jul 18 '06 #5
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.
Mar 7 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
1
by: Daniel Passwater via DotNetMonster.com | last post by:
I've written an app in C# in the compact framework. I've got a serial connection with a device running embedded C. We are using no flow control. That's not optional at this point. We are talking at...
4
by: Bruno Barros | last post by:
Hello, I don´t know if union REGS <dos.h> is part of this group, but i have a problem. At the moment i use turboc++lite and i don´t have reply when i execute the question code. Only a black...
6
by: alban | last post by:
Hello I have got some problems of compilation on a AIX IBM, I use the XLC compilator (And I can't install another one). I try to compile code Pro*c ".pc" (oracle), I need do a pre-compilation...
0
by: balajiv86 | last post by:
hi can anyone tell me the book which contains details abt inbuilt union regs in c
7
by: pbd22 | last post by:
Hi. I really need some advice on fine-tuning a stored procedure that is the meat of the search logic on my site. Customers are allowed to save searches, which dumps the search logic in a table...
4
by: jmarcrum | last post by:
I have to modify this assembly code in order to make it use interrupts. Right now, when I push button 1 on the microprocessor the count increments once (the LED's count in binary, using only 3 LED's...
6
dfound
by: dfound | last post by:
Hello, I am using Borland C++ 5.02 and I was trying to make ROM BIOS interrupts in a c program. But when I compile the program it says undefined structure REGS. I tried the program in a cpp program...
1
by: JKaur | last post by:
hello frnds, please tell me the difference between DOS interrupts and interrupts invoked using int86() function in C (are those 8086 intrupts?). In some text i have read these are different, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.