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

26 lines
419 B
ArmAsm
Raw Normal View History

2015-09-21 09:43:03 +02:00
/*
Minimal interrupt example.
2015-09-24 10:17:28 +02:00
Should print the characters 'ab' to screen.
2015-09-21 09:43:03 +02:00
TODO: is STI not needed because this interrupt is not maskable?
2015-09-24 10:17:28 +02:00
TODO: use IDTR as a base. Is the initial value 0 guaranteed?
2015-09-21 09:43:03 +02:00
*/
#include "common.h"
BEGIN
CLEAR
movw $handler, 0x00
movw $0x00, 0x02
2015-09-24 10:17:28 +02:00
int $0
PUTC($0x62)
jmp end
2015-09-21 09:43:03 +02:00
handler:
PUTC($0x61)
2015-09-24 10:17:28 +02:00
/* Returns to the int instruction. */
iret
end:
2015-09-21 09:43:03 +02:00
hlt
END