What is software interrupt with examples?

1 answer

Answer

1043427

2026-05-18 09:35

+ Follow

Linux
Linux

Interrupt generated by executing an instruction is called software interrupt. It's also called 'trap'. Software interrupts are generally used to make system calls i.e. to request operating system to perform an I/O operation or to run a new program.

Examples:

C++:

  1. A cout or cin statement would generate a software interrupt because it would make a system call to print something.
  2. A fork() statement in Linux would generate a software interrupt because it would make a system call to create a new process.

Assembly IA32:

  1. The instruction int 21h would generate a software interrupt which would request something from operating system (depending on the register values).

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.