something wrong with pic in pmode, please help!
Posted: Sun Apr 27, 2003 3:40 pm
I tried to reprogram pic but I think I couldnt manage to do it. What is wrong with this code??
I want to handle int8 (timer). Whenever I call int 8 softwarely, it works fine. But I want to do it with IRQ0.
Here is how I initialize pic. And full source is included.Please help:)
...
in al, (PIC8259MASTER + 1)
mov [Old82591Mask], al
in al, (PIC8259SLAVE + 1)
mov [Old82592Mask], al
mov dl, 28h
mov dh, 20h
call InitPic
mov al, 0feh ;just open int8
out (PIC8259MASTER + 1), al
mov al, 0ffh
out (PIC8259SLAVE + 1), al
...
proc InitPic
mov al, 11h
out PIC8259MASTER, al
out PIC8259SLAVE, al
mov al, dh
out PIC8259MASTER+1, al
mov al, dl
out PIC8259SLAVE+1, al
mov al, 4
out PIC8259MASTER+1, al
mov al, 2
out PIC8259SLAVE+1, al
mov al, 1
out PIC8259MASTER+1, al
out PIC8259SLAVE+1, al
ret
endp InitPic
[attachment deleted by admin]
I want to handle int8 (timer). Whenever I call int 8 softwarely, it works fine. But I want to do it with IRQ0.
Here is how I initialize pic. And full source is included.Please help:)
...
in al, (PIC8259MASTER + 1)
mov [Old82591Mask], al
in al, (PIC8259SLAVE + 1)
mov [Old82592Mask], al
mov dl, 28h
mov dh, 20h
call InitPic
mov al, 0feh ;just open int8
out (PIC8259MASTER + 1), al
mov al, 0ffh
out (PIC8259SLAVE + 1), al
...
proc InitPic
mov al, 11h
out PIC8259MASTER, al
out PIC8259SLAVE, al
mov al, dh
out PIC8259MASTER+1, al
mov al, dl
out PIC8259SLAVE+1, al
mov al, 4
out PIC8259MASTER+1, al
mov al, 2
out PIC8259SLAVE+1, al
mov al, 1
out PIC8259MASTER+1, al
out PIC8259SLAVE+1, al
ret
endp InitPic
[attachment deleted by admin]