2019-07-06 10:52:53 +02:00
|
|
|
|
;Adresses de port du controleur IRQ
|
2007-03-13 21:56:55 +01:00
|
|
|
|
MASTERPIC = 020h ;Adresse de base du PIC ma<6D>tre
|
|
|
|
|
SLAVEPIC = 0A0h ;Adresse de base du PIC esclave
|
|
|
|
|
IRQMASK = 001h ;Offset sur port de masquage
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;Commandes IRQ OCW2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
DISABLEROTATION = 000h ;Desactiver la rotation de priorit<69>s en mode EOI automatique
|
|
|
|
|
EOI = 020h ;End of Interrupt non sp<73>cifi<66>
|
2004-06-12 23:34:04 +02:00
|
|
|
|
COMMANDEOI = 060h ;Commande EOI particuli<6C>re
|
|
|
|
|
ENABLEROTATION = 080h ;Activer la rotation de priorit<69>s en mode EOI automatique
|
|
|
|
|
ROTATIONNOSPEC = 0A0h ;Rotation des priorit<69>s en mode EOI automatique
|
|
|
|
|
SETPRIORITY = 0C0h ;Definir la priorit<69>
|
|
|
|
|
ROTATIONSPEC = 0E0h ;Rotation des priorit<69>s en mode EOI sp<73>cifi<66>
|
|
|
|
|
|
|
|
|
|
;Position des vecteurs d'interruptions
|
2007-03-13 21:56:55 +01:00
|
|
|
|
MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions
|
2019-07-06 10:52:53 +02:00
|
|
|
|
SLAVEFIRSTVECTOR = 070h ;electroniques
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;OCW3 codes registres
|
|
|
|
|
IRR = 002h ;Interrupt Request Register
|
|
|
|
|
ISR = 003h ;In Service Register
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;OCW3 et modes
|
2004-06-12 23:34:04 +02:00
|
|
|
|
OCW3 = 008h ;OCW3
|
|
|
|
|
POLLING = 004h ;Polling bit
|
|
|
|
|
|
|
|
|
|
|
2019-07-06 10:52:53 +02:00
|
|
|
|
ISR = 0Bh ; Pas d'operation, pas de Poll, lire ISR OCW3
|
|
|
|
|
IRR = 0Ah ; Pas d'operation, pas de Poll, lire IRR
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2019-07-06 10:52:53 +02:00
|
|
|
|
;Autorise une interruption electronique
|
|
|
|
|
;Entree : %1 - Numero de l'interruption (0-15) <20> autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc enableirq uses ax cx dx, irq:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[irq]
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,MASTERPIC+IRQMASK
|
|
|
|
|
cmp al,7
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jbe .master
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,SLAVEPIC+IRQMASK
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov cl,al
|
|
|
|
|
and cl,7
|
|
|
|
|
mov al,1
|
|
|
|
|
shl al,cl
|
|
|
|
|
not al
|
|
|
|
|
mov ah,al
|
|
|
|
|
in al,dx
|
|
|
|
|
and al,ah
|
|
|
|
|
out dx,al
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;Desactive une interruption <20>lectronique
|
2005-12-05 09:16:09 +01:00
|
|
|
|
;Entr<74>e : %0 - Num<75>ro de l'interruption (0-15) <20> desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc disableirq uses ax cx dx, irq:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[irq]
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,MASTERPIC+IRQMASK
|
|
|
|
|
cmp al,7
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jbe .master
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,SLAVEPIC+IRQMASK
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov cl,al
|
|
|
|
|
and cl,7
|
|
|
|
|
mov al,1
|
|
|
|
|
shl al,cl
|
|
|
|
|
not al
|
|
|
|
|
mov ah,al
|
|
|
|
|
in al,dx
|
|
|
|
|
or al,ah
|
|
|
|
|
out dx,al
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2005-12-05 09:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;Signale "End Of Interrupt" de l'interruption %0
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc seteoi uses ax dx, irq:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[irq]
|
2005-12-05 09:16:09 +01:00
|
|
|
|
cmp al,7
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jbe .master
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov al,EOI
|
|
|
|
|
out SLAVEPIC,al
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov al,EOI
|
|
|
|
|
out MASTERPIC,al
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2005-12-05 09:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;Lit les masques d'un contr<74>leur IRQ dans ax, 0 master ou slave 1 ds %1
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc readimr uses bx dx, controleur:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov bx,[controleur]
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,MASTERPIC+ IRQMASK
|
|
|
|
|
cmp bl,0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jne .master
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,SLAVEPIC+ IRQMASK
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2005-12-05 09:16:09 +01:00
|
|
|
|
xor ah,ah
|
|
|
|
|
in al,dx
|
|
|
|
|
pop dx
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2005-12-05 09:16:09 +01:00
|
|
|
|
|
|
|
|
|
;Lit le registre d'<27>tat d'un contr<74>leur IRQ dans ax, 0 master ou slave 1 ds %1
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc readisr uses bx dx, controleur:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov bx,[controleur]
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,MASTERPIC
|
|
|
|
|
cmp bh,0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jne .master
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,SLAVEPIC
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,ISR
|
2005-12-05 09:16:09 +01:00
|
|
|
|
out dx,al
|
|
|
|
|
xor ah,ah
|
|
|
|
|
in al,dx
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;Lit le registre d'<27>tat d'un contr<74>leur IRQ dans al, 0 master ou slave 1 ds bh
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc readirr uses bx dx, controleur:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov bx,[controleur]
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,MASTERPIC
|
|
|
|
|
cmp bh,0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jne .master
|
2005-12-05 09:16:09 +01:00
|
|
|
|
mov dx,SLAVEPIC
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,IRR
|
2005-12-05 09:16:09 +01:00
|
|
|
|
out dx,al
|
|
|
|
|
xor ah,ah
|
|
|
|
|
in al,dx
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
2007-03-27 16:52:53 +02:00
|
|
|
|
;carry si enable et pas carry si pas enable
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc isenableirq uses ax cx dx, irq:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[irq]
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov dx,MASTERPIC+IRQMASK
|
|
|
|
|
cmp al,7
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jbe .master
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov dx,SLAVEPIC+IRQMASK
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov cl,al
|
|
|
|
|
and cx,7
|
|
|
|
|
in al,dx
|
|
|
|
|
neg al
|
|
|
|
|
bt ax,cx
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 16:52:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;carry si enable et pas carry si pas enable
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc isinserviceirq uses ax cx dx, irq:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[irq]
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov dx,MASTERPIC
|
|
|
|
|
cmp al,7
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jbe .master
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov dx,SLAVEPIC
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov cl,al
|
|
|
|
|
mov al,ISR
|
|
|
|
|
out dx,al
|
|
|
|
|
and cx,7
|
|
|
|
|
in al,dx
|
|
|
|
|
neg al
|
|
|
|
|
bt ax,cx
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 16:52:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;carry si enable et pas carry si pas enable
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc isrequestirq uses ax cx dx, irq:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[irq]
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov dx,MASTERPIC
|
|
|
|
|
cmp al,7
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jbe .master
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov dx,SLAVEPIC
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.master:
|
2007-03-27 16:52:53 +02:00
|
|
|
|
mov cl,al
|
|
|
|
|
mov al,IRR
|
|
|
|
|
out dx,al
|
|
|
|
|
and cx,7
|
|
|
|
|
in al,dx
|
|
|
|
|
neg al
|
|
|
|
|
bt ax,cx
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
|
|
|
|
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc installirqhandler uses eax bx cx edx si di ds es
|
2007-03-27 12:16:47 +02:00
|
|
|
|
push fs
|
2019-07-14 12:47:14 +02:00
|
|
|
|
stdcall mbcreate,interruptionbloc,256*ints.sizeof
|
2007-03-27 12:16:47 +02:00
|
|
|
|
mov es,ax
|
|
|
|
|
mov ax,0x0000
|
|
|
|
|
mov ds,ax
|
|
|
|
|
xor si,si
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.searchdummypointer:
|
2019-07-09 18:30:00 +02:00
|
|
|
|
virtual at si
|
|
|
|
|
.vector vector
|
|
|
|
|
end virtual
|
|
|
|
|
mov fs,[.vector.data.seg]
|
|
|
|
|
mov bx,[.vector.data.off]
|
2019-07-06 10:52:53 +02:00
|
|
|
|
cmp byte [fs:bx],0xCF ;iret
|
|
|
|
|
je .founded
|
2019-07-14 12:47:14 +02:00
|
|
|
|
add si,vector.sizeof
|
2007-03-27 12:16:47 +02:00
|
|
|
|
cmp si,256*4
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jb .searchdummypointer
|
2007-03-27 12:16:47 +02:00
|
|
|
|
xor edx,edx
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jmp .suite
|
|
|
|
|
.founded:
|
2019-07-09 18:30:00 +02:00
|
|
|
|
mov edx,[.vector.content]
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.suite:
|
2007-03-27 12:16:47 +02:00
|
|
|
|
xor cx,cx
|
|
|
|
|
xor si,si
|
|
|
|
|
xor di,di
|
|
|
|
|
cli
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.copy:
|
2019-07-09 18:30:00 +02:00
|
|
|
|
virtual at di
|
|
|
|
|
.ints ints
|
|
|
|
|
end virtual
|
|
|
|
|
mov [es:.ints.number],cl
|
|
|
|
|
mov [es:.ints.locked],0
|
|
|
|
|
mov [es:.ints.vector1.content],0
|
|
|
|
|
mov [es:.ints.vector3.content],0
|
|
|
|
|
mov [es:.ints.vector4.content],0
|
|
|
|
|
mov [es:.ints.vector5.content],0
|
|
|
|
|
mov [es:.ints.vector6.content],0
|
|
|
|
|
mov [es:.ints.vector7.content],0
|
|
|
|
|
mov [es:.ints.vector8.content],0
|
|
|
|
|
mov [es:.ints.launchedlow],0
|
|
|
|
|
mov [es:.ints.launchedhigh],0
|
|
|
|
|
mov [es:.ints.calledlow],0
|
|
|
|
|
mov [es:.ints.calledhigh],0
|
|
|
|
|
mov eax,[.vector.content]
|
2007-03-27 12:16:47 +02:00
|
|
|
|
cmp eax,edx
|
2019-07-06 10:52:53 +02:00
|
|
|
|
je .notarealvector
|
2019-07-09 18:30:00 +02:00
|
|
|
|
mov [es:.ints.vector1.content],eax
|
|
|
|
|
mov [es:.ints.activated],1
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jmp .copynext
|
|
|
|
|
.notarealvector:
|
2019-07-09 18:30:00 +02:00
|
|
|
|
mov [es:.ints.vector1.content],0
|
|
|
|
|
mov [es:.ints.activated],0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.copynext:
|
2007-03-27 12:16:47 +02:00
|
|
|
|
mov bx,cx
|
|
|
|
|
shl bx,3
|
|
|
|
|
sub bx,cx
|
2019-07-06 10:52:53 +02:00
|
|
|
|
add bx,coupling
|
2019-07-09 18:30:00 +02:00
|
|
|
|
mov [.vector.data.seg],cs
|
|
|
|
|
mov [.vector.data.off],bx
|
2019-07-14 12:47:14 +02:00
|
|
|
|
add si,vector.sizeof
|
|
|
|
|
add di,ints.sizeof
|
2007-03-27 12:16:47 +02:00
|
|
|
|
inc cl
|
|
|
|
|
cmp cl,0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jne .copy
|
|
|
|
|
.end:
|
2007-03-27 12:16:47 +02:00
|
|
|
|
pop fs
|
|
|
|
|
sti
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
|
|
|
|
|
2007-03-27 16:52:53 +02:00
|
|
|
|
interruptionbloc db '/interrupts',0
|
|
|
|
|
|
|
|
|
|
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc savecontext uses eax si ds, pointer:word
|
2007-03-28 17:52:40 +02:00
|
|
|
|
pushfd
|
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
push edx
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
push ds
|
|
|
|
|
push es
|
|
|
|
|
push fs
|
|
|
|
|
push gs
|
|
|
|
|
push ss
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov si,[pointer]
|
2007-03-28 17:52:40 +02:00
|
|
|
|
mov ds,[ss:bp+4]
|
|
|
|
|
mov eax,ebp
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,word [ss:bp]
|
2007-03-28 17:52:40 +02:00
|
|
|
|
push eax
|
2019-07-06 10:52:53 +02:00
|
|
|
|
push word [ss:bp+4]
|
2007-03-28 17:52:40 +02:00
|
|
|
|
xor eax,eax
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,word [ss:bp+2]
|
2007-03-28 17:52:40 +02:00
|
|
|
|
push eax
|
|
|
|
|
mov ax,bp
|
|
|
|
|
add ax,4
|
|
|
|
|
push eax
|
2019-07-09 18:30:00 +02:00
|
|
|
|
virtual at si
|
|
|
|
|
.regs regs
|
|
|
|
|
end virtual
|
|
|
|
|
pop [.regs.sesp]
|
|
|
|
|
pop [.regs.seip]
|
|
|
|
|
pop [.regs.scs]
|
|
|
|
|
pop [.regs.sebp]
|
|
|
|
|
pop [.regs.sss]
|
|
|
|
|
pop [.regs.sgs]
|
|
|
|
|
pop [.regs.sfs]
|
|
|
|
|
pop [.regs.ses]
|
|
|
|
|
pop [.regs.sds]
|
|
|
|
|
pop [.regs.sedi]
|
|
|
|
|
pop [.regs.sesi]
|
|
|
|
|
pop [.regs.sedx]
|
|
|
|
|
pop [.regs.secx]
|
|
|
|
|
pop [.regs.sebx]
|
|
|
|
|
pop [.regs.seax]
|
|
|
|
|
pop [.regs.seflags]
|
2019-07-13 20:49:22 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc restorecontextg, pointer:word
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov si,[pointer]
|
2019-07-09 18:30:00 +02:00
|
|
|
|
virtual at si
|
|
|
|
|
.regs regs
|
|
|
|
|
end virtual
|
|
|
|
|
pushd [cs:.regs.sesi]
|
|
|
|
|
pushd [cs:.regs.seflags]
|
|
|
|
|
mov eax,[cs:.regs.seax]
|
|
|
|
|
mov ebx,[cs:.regs.sebx]
|
|
|
|
|
mov ecx,[cs:.regs.secx]
|
|
|
|
|
mov edx,[cs:.regs.sedx]
|
|
|
|
|
mov edi,[cs:.regs.sedi]
|
|
|
|
|
mov ebp,[cs:.regs.sebp]
|
|
|
|
|
mov es,[cs:.regs.ses]
|
|
|
|
|
mov fs,[cs:.regs.sfs]
|
|
|
|
|
mov gs,[cs:.regs.sgs]
|
|
|
|
|
mov ds,[cs:.regs.sds]
|
2007-03-27 12:16:47 +02:00
|
|
|
|
popfd
|
|
|
|
|
pop esi
|
|
|
|
|
pop [cs:dummy]
|
2019-07-13 20:49:22 +02:00
|
|
|
|
db 0xCA,0x02,0x00 ;ret 2
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
coupling:
|
2019-07-06 10:52:53 +02:00
|
|
|
|
repeat 256
|
|
|
|
|
push %+256
|
2019-07-09 18:30:00 +02:00
|
|
|
|
push irqhandlers
|
2007-03-27 12:16:47 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
end repeat
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
|
|
|
|
interrupt dw 0
|
|
|
|
|
dummy dw 0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
calling_reg regs
|
|
|
|
|
function_reg regs
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
|
|
|
|
irqhandlers:
|
|
|
|
|
cli
|
|
|
|
|
pop [cs:interrupt]
|
2019-07-09 18:30:00 +02:00
|
|
|
|
stdcall savecontext,calling_reg
|
2019-07-06 10:52:53 +02:00
|
|
|
|
stdcall irqhandler,[cs:interrupt]
|
2019-07-09 18:30:00 +02:00
|
|
|
|
stdcall restorecontextg,calling_reg
|
2007-03-27 12:16:47 +02:00
|
|
|
|
sti
|
|
|
|
|
iret
|
|
|
|
|
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc irqhandler, int:word
|
2007-03-27 12:16:47 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 18:30:00 +02:00
|
|
|
|
stdcall mbfindsb,interruptionbloc,cs
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jc .end
|
2007-03-27 12:16:47 +02:00
|
|
|
|
mov es,ax
|
2019-07-06 10:52:53 +02:00
|
|
|
|
mov ax,[int]
|
2007-03-27 12:16:47 +02:00
|
|
|
|
sub ax,256
|
2019-07-14 12:47:14 +02:00
|
|
|
|
mov cx,ints.sizeof
|
2007-03-27 12:16:47 +02:00
|
|
|
|
mul cx
|
|
|
|
|
mov si,ax
|
2019-07-09 18:30:00 +02:00
|
|
|
|
virtual at si
|
|
|
|
|
.ints ints
|
|
|
|
|
end virtual
|
|
|
|
|
add [es:.ints.calledlow],1
|
|
|
|
|
adc [es:.ints.calledhigh],0
|
|
|
|
|
cmp [es:.ints.activated],1
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jne .end
|
2019-07-09 18:30:00 +02:00
|
|
|
|
add [es:.ints.launchedlow],1
|
|
|
|
|
adc [es:.ints.launchedhigh],0
|
|
|
|
|
lea si,[es:.ints.vector1]
|
2007-03-27 12:16:47 +02:00
|
|
|
|
mov cl,8
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.launchall:
|
2019-07-09 18:30:00 +02:00
|
|
|
|
virtual at si
|
|
|
|
|
.vector vector
|
|
|
|
|
end virtual
|
|
|
|
|
cmp [es:.vector.content],0
|
2019-07-06 10:52:53 +02:00
|
|
|
|
je .end
|
|
|
|
|
push word [cs:calling_reg.seflags]
|
2007-03-27 12:16:47 +02:00
|
|
|
|
push cs
|
2019-07-09 18:30:00 +02:00
|
|
|
|
push .back
|
|
|
|
|
push [es:.vector.data.seg]
|
|
|
|
|
push [es:.vector.data.off]
|
|
|
|
|
stdcall savecontext,function_reg
|
|
|
|
|
stdcall restorecontextg,calling_reg
|
2007-03-27 12:16:47 +02:00
|
|
|
|
db 0xCB
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.back:
|
2007-03-27 12:16:47 +02:00
|
|
|
|
cli
|
2019-07-09 18:30:00 +02:00
|
|
|
|
stdcall savecontext,calling_reg
|
|
|
|
|
stdcall restorecontextg,function_reg
|
2019-07-06 10:52:53 +02:00
|
|
|
|
.next:
|
2019-07-14 12:47:14 +02:00
|
|
|
|
add si,vector.sizeof
|
2007-03-27 12:16:47 +02:00
|
|
|
|
dec cl
|
2019-07-06 10:52:53 +02:00
|
|
|
|
jnz .launchall
|
|
|
|
|
.end:
|
2007-03-27 12:16:47 +02:00
|
|
|
|
ret
|
2019-07-06 10:52:53 +02:00
|
|
|
|
endp
|
2007-03-27 12:16:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|