Basics of interrupt chaining? (Developers)
Hi all,
There was a previous discussion about interrupt chaining here, but that just confused me more.
For context, I'm still programming the Sound Blaster, so I'm doing an IRQ 7 (for DOSBox) hardware interrupt handler.
What is the basic method of chaining an interrupt?  From what I've gathered, I can't just place the segment:offset in registers and JMP, but have to store the IP and CS in memory (in this order) and then far jump by a pointer reference.
Or is CALL better?
Here is the code I've come up with for this.  This is WASM btw in the tiny model, hence cs=ds.
Am I on the right track?
        ;; Load IRQ 7 handler.
        mov     ah, 0x37
        mov     al, 0x07        ; In DOSBox, the SB uses IRQ 7.
        int     0x21
        ;; Now es=code segment, bx=instruction pointer
        ;; And save in pointer
        mov     irq_handler, bx
        mov     irq_handler+2, es
        ;; Save our IRQ 7 handler
        lea     dx, sb_interrupt
        mov     cx, cs          ; redundant since ds 
        mov     ds, cx          ; hasn't been modified
        mov     ah, 0x25
        mov     al, 0x07        ; again, redundant but explicit.
        int     0x21
; [snip]
        sb_interrupt proc
                jmp far ptr irq_handler
                irq_handler     dw      0,      0
        sb_interrupt    endp
Complete thread:
- Basics of interrupt chaining? - myrkraverk, 13.12.2012, 19:39 ![Open in board view [Board]](img/board_d.gif) ![Open in mix view [Mix]](img/mix_d.gif) - Basics of interrupt chaining? - myrkraverk, 13.12.2012, 20:19
- Basics of interrupt chaining? - Japheth, 13.12.2012, 21:31- And now: int 0x21 in hw interrupt handler? - myrkraverk, 14.12.2012, 02:58- And now: int 0x21 in hw interrupt handler? - Japheth, 14.12.2012, 06:10
- And now: int 0x21 in hw interrupt handler? - tom, 14.12.2012, 18:25
- And now: int 0x21 in hw interrupt handler? - bretjohn, 15.12.2012, 01:29- And now: int 0x21 in hw interrupt handler? - myrkraverk, 15.12.2012, 15:52- And now: int 0x21 in hw interrupt handler? - bretjohn, 17.12.2012, 18:08- And now: int 0x21 in hw interrupt handler? - myrkraverk, 18.12.2012, 20:16- And now: int 0x21 in hw interrupt handler? - tom, 19.12.2012, 15:54
 
 
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 18.12.2012, 20:16
 
- And now: int 0x21 in hw interrupt handler? - bretjohn, 17.12.2012, 18:08
 
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 15.12.2012, 15:52
 
 
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 14.12.2012, 02:58
- Basics of interrupt chaining? - bretjohn, 14.12.2012, 19:43
 
 Board view
Board view Mix view
Mix view