# Software interrupts (ivss) A **software interrupt** is requested by the program through `int`. This complete example installs a handler, requests an interrupt, and resumes at `halt`: ```asm .section my_code ld $handler, %r1 csrwr %r1, %handler int halt handler: ld $42, %r5 iret .end ``` The emulator sets a pending software flag when it executes `int`. Its following interrupt check builds the frame, writes cause four, and transfers to the installed handler. The handler leaves forty-two in `%r5`; `iret` restores the saved state and returns to the instruction following `int`. Software delivery does not require `-timer` or `-terminal`. Those options enable host-generated device events, not the program's own request. In this implementation the software case does not consult the timer, terminal, or global hardware-mask bits. Do not assume that setting the global status mask blocks every interrupt kind. The handler and internal interrupt-enable checks still apply to delivery. Source: [emulator.c](https://github.com/yanevskiv/ivss/blob/main/src/emulator.c).