assemblynasminterruptx86-16

Is it possible to exit from an ISR without returning to the calling code?


I am trying to create an Interrupt Service Routine in Assembly, which returns not to the location from the interrupt was called, but to an label.

Should i just jump to the label and not use iret (and any other interrupt-related instruction), or there is a specific method to do this?

For example:

[org 0x7c00]

; setting up ISR for int 69h (isr69h is the ISR)
; (i did it already, and worked fine with IRET, but i dont want to return to the caller)
; ...

int 69h ; test
; don't continue code from here

; some more code...

continue_from_here:
    jmp $

isr69h:
    ; do something
    jmp continue_from_here ; is it enough, or should i place here more code? (for example: restoring FLAGS etc.)

times 510-($-$$) db 0 ; padding
dw 0xAA55 ; boot signature

(i use netwide assembler)


Solution

  • Sure, there is no rule that you have to IRET. Once the interrupt handler is entered, it has control of the CPU and can do whatever it likes.

    Just a couple notes: