I guess RTI should not restore the Interrupt flag because when I unset it with CLI and then RTI from the Interrupt routine it is set again bacause it was saved when entering the IRQ.
OR the IRQ routine may simply set the I flag after the Status-Register is saved.
Same with NMI.
EDIT:
Found this in the datasheet :)
The Program Counter and Processor Status Register are stored in the stack.
The microprocessor will then set the interrupt mask flag high so that no further interrupts may occur.
I guess RTI should not restore the Interrupt flag because when I unset it with CLI and then RTI from the Interrupt routine it is set again bacause it was saved when entering the IRQ.
OR the IRQ routine may simply set the I flag after the Status-Register is saved. Same with NMI.
EDIT: Found this in the datasheet :) The Program Counter and Processor Status Register are stored in the stack. The microprocessor will then set the interrupt mask flag high so that no further interrupts may occur.