Re: A86: interrupts


[Prev][Next][Index][Thread]

Re: A86: interrupts




rabidcow@juno.com wrote:
> 
> On Thu, 30 Apr 1998 20:55:02 -0400 Dux Gregis <assets@eden.rutgers.edu>
> writes:
> >
> >I have two questions:
> >
> >Will the disable interrupt instruction disable the interrupt in
> >interrupt mode 2?
> should, don't know for sure.
> 
> >And, if instead of pushing the registers in an interrupt routine you
> >did
> ><pop hl>, would you have the program counter in hl from where the
> >routine was called?  I don't think this would be possible using the
> >regular interrupt because you would destroy the registers, but maybe
> >using interrupt mode 2?
> >
> yes, you'd get the return address in hl.  there are ways to save the
> registers and get this.  you could save sp to memory:
>         ld (save_sp),sp
>         push hl
>         push de
>         etc..
>         ld hl,save_sp
>         ld e,(hl)
>         inc hl
>         ld d,(hl)
> 
> or the register(s):
>         ld (save_hl),hl
>         pop hl
>         push hl ;you do want to return there?

Thanks.  So does this mean that you could override certain ROM routines
by checking the page and the counter?

> 
> or use exchange, but i don't know if those registers are used for
> anything:

The shadow register (when in the interrupt) have the preserved regs in
them.  If you exchange the registers in the user interrupt, you'll screw
up the registers used where the int was called.  I was looking at the
rom just now; it's beyond me why the registers have to be pushed and
popped -- at the very most only hl register should be.

>         exx
>         ex af,af'
>         pop hl
>         push hl
> 
>         exx
>         ex af,af'
> 
> -josh
> 
> _____________________________________________________________________
> You don't need to buy Internet access to use free Internet e-mail.
> Get completely free e-mail from Juno at http://www.juno.com
> Or call Juno at (800) 654-JUNO [654-5866]


Follow-Ups: References: