; MIT License, Copyright (c) 2021 Marvin Borner %macro INTERRUPT_REGISTER 1 dd int%1 %endmacro %macro INTERRUPT_ERR 1 int%1: push %1 jmp interrupt_common %endmacro %macro INTERRUPT_NOERR 1 int%1: push 0 push %1 jmp interrupt_common %endmacro extern interrupt_handler interrupt_common: cld pushad push ds push es push fs push gs mov ax, 0x20 mov ds, ax mov es, ax mov fs, ax mov gs, ax push esp call interrupt_handler mov esp, eax pop gs pop fs pop es pop ds popad add esp, 8 iret INTERRUPT_NOERR 0 INTERRUPT_NOERR 1 INTERRUPT_NOERR 2 INTERRUPT_NOERR 3 INTERRUPT_NOERR 4 INTERRUPT_NOERR 5 INTERRUPT_NOERR 6 INTERRUPT_NOERR 7 INTERRUPT_ERR 8 INTERRUPT_NOERR 9 INTERRUPT_ERR 10 INTERRUPT_ERR 11 INTERRUPT_ERR 12 INTERRUPT_ERR 13 INTERRUPT_ERR 14 INTERRUPT_NOERR 15 INTERRUPT_NOERR 16 INTERRUPT_ERR 17 INTERRUPT_NOERR 18 INTERRUPT_NOERR 19 INTERRUPT_NOERR 20 INTERRUPT_NOERR 21 INTERRUPT_NOERR 22 INTERRUPT_NOERR 23 INTERRUPT_NOERR 24 INTERRUPT_NOERR 25 INTERRUPT_NOERR 26 INTERRUPT_NOERR 27 INTERRUPT_NOERR 28 INTERRUPT_NOERR 29 INTERRUPT_ERR 30 INTERRUPT_NOERR 31 INTERRUPT_NOERR 32 INTERRUPT_NOERR 33 INTERRUPT_NOERR 34 INTERRUPT_NOERR 35 INTERRUPT_NOERR 36 INTERRUPT_NOERR 37 INTERRUPT_NOERR 38 INTERRUPT_NOERR 39 INTERRUPT_NOERR 40 INTERRUPT_NOERR 41 INTERRUPT_NOERR 42 INTERRUPT_NOERR 43 INTERRUPT_NOERR 44 INTERRUPT_NOERR 45 INTERRUPT_NOERR 46 INTERRUPT_NOERR 47 global interrupt_table interrupt_table: INTERRUPT_REGISTER 0 INTERRUPT_REGISTER 1 INTERRUPT_REGISTER 2 INTERRUPT_REGISTER 3 INTERRUPT_REGISTER 4 INTERRUPT_REGISTER 5 INTERRUPT_REGISTER 6 INTERRUPT_REGISTER 7 INTERRUPT_REGISTER 8 INTERRUPT_REGISTER 9 INTERRUPT_REGISTER 10 INTERRUPT_REGISTER 11 INTERRUPT_REGISTER 12 INTERRUPT_REGISTER 13 INTERRUPT_REGISTER 14 INTERRUPT_REGISTER 15 INTERRUPT_REGISTER 16 INTERRUPT_REGISTER 17 INTERRUPT_REGISTER 18 INTERRUPT_REGISTER 19 INTERRUPT_REGISTER 20 INTERRUPT_REGISTER 21 INTERRUPT_REGISTER 22 INTERRUPT_REGISTER 23 INTERRUPT_REGISTER 24 INTERRUPT_REGISTER 25 INTERRUPT_REGISTER 26 INTERRUPT_REGISTER 27 INTERRUPT_REGISTER 28 INTERRUPT_REGISTER 29 INTERRUPT_REGISTER 30 INTERRUPT_REGISTER 31 INTERRUPT_REGISTER 32 INTERRUPT_REGISTER 33 INTERRUPT_REGISTER 34 INTERRUPT_REGISTER 35 INTERRUPT_REGISTER 36 INTERRUPT_REGISTER 37 INTERRUPT_REGISTER 38 INTERRUPT_REGISTER 39 INTERRUPT_REGISTER 40 INTERRUPT_REGISTER 41 INTERRUPT_REGISTER 42 INTERRUPT_REGISTER 43 INTERRUPT_REGISTER 44 INTERRUPT_REGISTER 45 INTERRUPT_REGISTER 46 INTERRUPT_REGISTER 47