interrupt_zero_divide.S 338 B

1234567891011121314151617181920212223
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#interrupts */
  2. #include "common.h"
  3. BEGIN
  4. CLEAR
  5. movw $handler, 0x00
  6. movw %cs, 0x02
  7. mov $0, %ax
  8. div %ax
  9. hlt
  10. handler:
  11. mov myvar, %ax
  12. incw myvar
  13. PRINT_WORD_HEX
  14. PRINT_NEWLINE
  15. iret
  16. myvar:
  17. #if 1
  18. .word 0x0000
  19. #else
  20. .word 0x0090
  21. #endif