.set IRQ_BASE, 0x20 .section .text .extern handle_int .global int_ignore .macro handle_exception num .global handle_exception\num handle_exception\num: movb $\num, (int_number) movl $exch_\num, (int_handler) jmp int_bottom .endm .macro handle_irq num .global handle_irq\num handle_irq\num: movb $\num + IRQ_BASE, (int_number) movl $irqh_\num, (int_handler) jmp int_bottom .endm handle_irq 0x00 handle_irq 0x01 handle_exception 0x00 handle_exception 0x01 handle_exception 0x02 handle_exception 0x03 handle_exception 0x06 handle_exception 0x07 handle_exception 0x08 handle_exception 0x0D int_ignore: movb $0xFF, (int_number) movl $0x00, (int_handler) int_bottom: cli pushl %esp push (int_number) pushl (int_handler) call handle_int movl %eax, %esp // Set the stack pointer to the return value of handle_int pop %eax pop %eax pop %eax pop %eax sti hlt .data int_number: .byte 0 int_handler: .int 0