Code: Select all
initpic:
mov al,0x11
out 0x20,al
out 0xa0,al
mov al,0x8
out 0x21,al
mov al,0x70
out 0xa1,al
mov al,4
out 0x21,al
mov al,0x2
out 0xa1,al
mov al,1
out 0x21,al
out 0xa1,al
mov al,0xfd
out 0x21,al
mov al,0xff
out 0xa1,al
Code: Select all
irq1:
pusha
mov al,0x20 ;the acknowledge interrupt code
out 0x20,al
in al,60h
popa
iret
Code: Select all
setivt:
xor dx,dx
mov gs,dx
mov [gs:0x9*4+2],cs
mov [gs:0x9*4],irq1
EDIT: Added the acknowledge interrupt code