projects
/
ld45_start_nothing
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
foo
[ld45_start_nothing]
/
src
/
intr.inc
diff --git
a/src/intr.inc
b/src/intr.inc
index
ac57934
..
a96b164
100644
(file)
--- a/
src/intr.inc
+++ b/
src/intr.inc
@@
-1,7
+1,9
@@
; vi:filetype=nasm ts=8 sts=8 sw=8:
PIC1_CMD equ 020h
; vi:filetype=nasm ts=8 sts=8 sw=8:
PIC1_CMD equ 020h
+PIC1_DATA equ 021h
PIC2_CMD equ 0a0h
PIC2_CMD equ 0a0h
+PIC2_DATA equ 0a1h
OCW2_EOI equ 020h
OCW3_ISR equ 00bh
IRQ_OFFSET equ 32
OCW2_EOI equ 020h
OCW3_ISR equ 00bh
IRQ_OFFSET equ 32
@@
-10,35
+12,34
@@
IRQ_OFFSET equ 32
%macro set_irq_vector 2
%macro set_irq_vector 2
- push dword IRQ_TO_INTR(%1)
push dword %2
push dword %2
+ push dword IRQ_TO_INTR(%1)
call set_intr
call set_intr
+ add esp, 8
%endmacro
%macro mask_irq 1
%if %1 < 8
%endmacro
%macro mask_irq 1
%if %1 < 8
-%assign port PIC1_DATA
-%assign mask (1 << %1)
+ in al, PIC1_DATA
+ or al, (1 << %1)
+ out PIC1_DATA, al
%else
%else
-%assign port PIC2_DATA
-%assign mask (1 << (%1 - 8))
+ in al, PIC2_DATA
+ or al, (1 << (%1 - 8))
+ out PIC2_DATA, al
%endif
%endif
- in al, port
- or al, mask
- out port, al
%endmacro
%macro unmask_irq 1
%if %1 < 8
%endmacro
%macro unmask_irq 1
%if %1 < 8
-%assign port PIC1_DATA
-%assign mask ~(1 << %1)
+ in al, PIC1_DATA
+ and al, ~(1 << %1)
+ out PIC1_DATA, al
%else
%else
-%assign port PIC2_DATA
-%assign mask ~(1 << (%1 - 8))
+ in al, PIC2_DATA
+ and al, ~(1 << (%1 - 8))
+ out PIC2_DATA, al
%endif
%endif
- in al, port
- and al, mask
- out port, al
%endmacro
%macro end_of_irq 1
%endmacro
%macro end_of_irq 1
@@
-52,5
+53,6
@@
IRQ_OFFSET equ 32
extern idt
%ifndef INTR_ASM_
extern idt
%ifndef INTR_ASM_
+ extern init_intr
extern set_intr
%endif
extern set_intr
%endif