Files
x86-bare-metal-examples/interrupt_zero_divide.S

23 lines
338 B
ArmAsm
Raw Permalink Normal View History

2018-12-04 09:46:27 +00:00
/* https://github.com/cirosantilli/x86-bare-metal-examples#interrupts */
2015-09-24 10:17:28 +02:00
#include "common.h"
BEGIN
CLEAR
movw $handler, 0x00
2015-09-29 23:55:54 +02:00
movw %cs, 0x02
mov $0, %ax
2015-09-24 10:17:28 +02:00
div %ax
2015-10-21 21:41:07 +02:00
hlt
2015-09-24 10:17:28 +02:00
handler:
mov myvar, %ax
incw myvar
PRINT_WORD_HEX
PRINT_NEWLINE
2015-10-21 21:41:07 +02:00
iret
myvar:
#if 1
.word 0x0000
#else
.word 0x0090
#endif