interrupt.S 328 B

12345678910111213141516
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#interrupts */
  2. #include "common.h"
  3. BEGIN
  4. CLEAR
  5. /* Set address of the handler for interrupt 0. */
  6. movw $handler, 0x00
  7. /* Set code segment of the handler for interrupt 0. */
  8. mov %cs, 0x02
  9. int $0
  10. PUTC $'b
  11. hlt
  12. handler:
  13. PUTC $'a
  14. iret