We help IT Professionals succeed at work.

Interrupt handler in vc

javadp
javadp asked
on
how can i write a interrupt handler for a device in vc++?
are exist any sample source for it?
Comment
Watch Question

ekc

Commented:

Do you mean to call an interrupt from C++ code?
If you mean that, it is easy, just embed your assembler code enclosing it in __asm keywod block...

// Example of the __asm keyword
__asm                  // __asm block
{
   mov eax, 01h
   int 10h
}

If you intent to do this a little bit "higher", you will probably need some device protocole manual or some kind of driver + it's API.
Normally, external devices go with some piece of software alowing easy access, some set of libraries, .h files to be included in your project, maybe even COM API ans so on, all depending on the vendor.
What device you are dealing with?

Author

Commented:
I have a card that shelf design it.
and i want read data from it where interrupted.
ekc

Commented:
I don't undertand you very well...
What type of the card? Magnetic one? Maybe the device is card reader?
What is shelf?
How the device is connected to the computer (RS-232, paralel port, has it own board etc)?
Do you have some kind of documentation and/or software with it?

Author

Commented:
i have an own board.
i make it and havn't any doc for it.
ekc

Commented:
Then its easy - you have full control because you know the way it operates. Where exactly do you connect it?
ekc,
   but can we use the code u mention in windows? I mean not Dos box at least. As far as in know, we need to develop a driver for it.

ekc

Commented:
Of course, asm {} permits embed thew assembler code in C/C++ program...
But, maybe you even don't need asm, maybe everything can be done in pure C/C++. This depends on the device details... What kind of interface it has?

Author

Commented:
I have an ISA card with IRQ=3 and IO=0x300-031f
Commented:
In this case, you'll probably have to use a little bit of assembler, but not to much. Only in the parts that directly call interrupt... The rest of the processing can be done in the C. The asm {} directive, embedded in the C++ code is the best commpromise for you...
Note, that you can't access interrupts from NT machine!
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11441638.html
http://www.experts-exchange.com/questions/Q.11464718.html
http://www.experts-exchange.com/questions/Q.20003263.html
http://www.experts-exchange.com/questions/Q.20003291.html
http://www.experts-exchange.com/questions/Q.20004596.html
http://www.experts-exchange.com/questions/Q.20004598.html
http://www.experts-exchange.com/questions/Q.20083504.html
http://www.experts-exchange.com/questions/Q.20089543.html
http://www.experts-exchange.com/questions/Q.20089544.html
http://www.experts-exchange.com/questions/Q.20093071.html
http://www.experts-exchange.com/questions/Q.20102935.html
http://www.experts-exchange.com/questions/Q.20104815.html
http://www.experts-exchange.com/questions/Q.20106878.html
http://www.experts-exchange.com/questions/Q.20113618.html
http://www.experts-exchange.com/questions/Q.20114035.html
http://www.experts-exchange.com/questions/Q.20125872.html
http://www.experts-exchange.com/questions/Q.20134344.html
http://www.experts-exchange.com/questions/Q.20144267.html
http://www.experts-exchange.com/questions/Q.20153424.html
http://www.experts-exchange.com/questions/Q.20154677.html
http://www.experts-exchange.com/questions/Q.20155179.html
http://www.experts-exchange.com/questions/Q.20177633.html
http://www.experts-exchange.com/questions/Q.20181455.html
http://www.experts-exchange.com/questions/Q.20181839.html
http://www.experts-exchange.com/questions/Q.20186426.html
http://www.experts-exchange.com/questions/Q.20188240.html
http://www.experts-exchange.com/questions/Q.20227524.html
http://www.experts-exchange.com/questions/Q.20230698.html
http://www.experts-exchange.com/questions/Q.20239968.html
http://www.experts-exchange.com/questions/Q.20251059.html
http://www.experts-exchange.com/questions/Q.20253443.html
http://www.experts-exchange.com/questions/Q.20256439.html
http://www.experts-exchange.com/questions/Q.20274261.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.11008242.html
http://www.experts-exchange.com/questions/Q.20089763.html
http://www.experts-exchange.com/questions/Q.20106021.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Comment from expert accepted as answer.

Computer101
E-E Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.