Re: Why ISR contains no arguments and return type is void

From: Roger Lascelles (rogerlasAToptusnet.com.au)
Date: 08/25/04


Date: Wed, 25 Aug 2004 20:27:49 +1000

If an interrupt can be caused by 3 causes, A, B, or C then the condition
which caused the interrupt is

Condition = CauseA OR CauseB OR CauseC .

You know this condition when the interrupt occurs. Thats all I was saying.

Because you know this condition, you check registers and variables to work
out whether A, B, or C occured. But you don't check for cause X, becuase
you know the condition which produces the interrupt.

Roger

"Active8" <reply2group@ndbbm.net> wrote in message
news:54ubmrin7012$.dlg@news.individual.net...
> On Tue, 24 Aug 2004 20:13:50 +1000, Roger Lascelles wrote:
>
> > An ISR is called when a hardware event occurs and is not called by code,
so
> > parameters cannot be passed to it. In addition, when you write an ISR,
you
> > know what conditions caused the interrupt,
>
> Not always, you may have to check flags while in the ISR to
> determine the event.
>
> > and therefore know what to do
> > about it, without needing parameters to give additional information.
> >
> > An ISR returns nothing, because there is no calling code to read the
> > returned values - on return, program execution returns to the original
> > instruction stream.
> >
> > Roger
> >
> This is not entirely true, but the OP hasn't even bothered to
> mention what friggin' uP he's using. In ix86 ass'y, there are BIOS
> Ints. You place a value like which sector to read in the ax or eax
> register, IIRC, and the return value (success/failure) is returned
> there. Check Ralph Brown's INT list. FYI, I wrote a boot sector
> program to load the boot code into that special location (55aa or
> aa55). It took 3 attempts to read the sector. I initially programmed
> a infinite loop to read the sector until success and NAV's
> Bloodhound TM scanner promptly let me know I had a memory resident
> virus. Pretty cool. Nowdays, NAV sucks. TFB.
>
> Anyway, Let's talk PICs for sake of argument. You *can* put a value
> in a register before returning from your ISR. You can also load a
> file register(s) with whatever status(es) you need to check in the
> ISR before the ISR is called but you might encounter race conditions
> - Google "the dining philosophers". You can also call the ISR from
> code and use a retlw instead of using retfie. You'd set up a
> conditional to check a register to see if the int flag was set by a
> hdw int, or if you set it yourself - check whether you *can* set
> that flag yourself first. Again, a race condition will foul up your
> day, so always consider what might happen if while in the process of
> calling that int code, a real int occurs. If you can set the int
> flag before doing anything else, that instruction will finish
> executing and lock out pending ints.
>
> Maybe you don't care if an int executes while the program is
> processing your call. Just remember you have to save any registers
> you're using (first order of biz in an ISR) that might get wiped out
> when the real int occurs.
>
> Another thing you can do is post your questions to piclist.org,
> avrfreaks, or an appropriate programming group instead of here.
>
> HTH
>
> --
> Best Regards,
> Mike



Relevant Pages

  • Re: GIISR_INFO Struct
    ... Just want to clarify a bit, This particular device has 2 Interrupt ... I think perhaps you are confusing what you have to do in an ISR and an ... register pending/enable mask pair which is what GIISR is set up for. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: GIISR_INFO Struct
    ... I think perhaps you are confusing what you have to do in an ISR and an ... all of the interrupt servicing should be in the IST. ... register pending/enable mask pair which is what GIISR is set up for. ... Now, if UseMaskReg is FALSE, the port value is masked with the Mask ...
    (microsoft.public.windowsce.platbuilder)
  • Re: need some help here :(
    ... you see i'm trying to execute INT 1Ah and read off the return values ... of INT 1Ah states that I must work in the REAL mode and not the v8086 ... This is determined by a bit in the descriptor that's loaded into the cs register. ... To use a bios interrupt, you want 16-bit code. ...
    (alt.lang.asm)
  • Re: PCI Driver ISR configuration.
    ... I am using the generic ISR and I send (with the ... KernelLibIoControl) the address of the card interrupt register and the ... > Is your network card has installable ISR? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Why ISR contains no arguments and return type is void
    ... you may have to check flags while in the ISR to ... You place a value like which sector to read in the ax or eax ... Check Ralph Brown's INT list. ... in a register before returning from your ISR. ...
    (sci.electronics.design)