×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

interrupt vector

interrupt vector

interrupt vector

(OP)
I don't mean to be a nucence!
I realize that the last question about interrupts is impossible, after a little reading up on interrupts.
This one, i hope, should be possible. How would i go about finding the interrupt vector inside the interrupt handler.
The handler is going to be calling functions handling data in multiple structures based on IRQ's and to save space i need only one set of these functions handled by multiple interrupts. Any help is apprectiated.

RE: interrupt vector

You can't, not reliably anyway.

Since you're doing IRQ's you CAN ask the PIC what IRQ's he's still handling... but if he's handling multiple IRQ's at the same time, it can be difficult to say WHICH IRQ got you called.  While it's likely to work that way, I wouldn't trust my program to run reliably on that.

What you do is to set several dummy int handlers:

IRQ01handler proc
   mov  IRQnum,01
   jump realIRQhandler
IRQ01handler endp

IRQ02handler proc
   mov  IRQnum,02
   jump realIRQhandler
IRQ02handler endp

IRQ03handler proc
   mov  IRQnum,03
   jump realIRQhandler
IRQ03handler endp

realIRQhandler proc
   mov esi, IRQnum
   ;do whatever....
   iret
realIRQhandler endp


...and of course set each dummy handler to the proper interrupt vector.

"Information has a tendency to be free.  Which means someone will always tell you something you don't want to know."

RE: interrupt vector

(OP)
perfect,
that will work and i think i can retain it in the class structure.
my next move was going to be write duplicate header files w/ each member named diferently like a_... or b_... . which would have consumed memory, time, processor, etc.
thank you

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close