below is a program that works. It's written in PB/DOS assembler and intercepts the INT7 interupt, does a trivial task (increment a counter and pulse one output) then clears the interrupt and returns.
I suspect you are forgetting to clear the interrupt before you exit the ISR.
Hope this gives you some pointers on how to do it in your case.
Paul.
Code:
REM measure interrupt latency REM signal generator is putting square wave onto ISA int7 line REM scope is looking at port 128 o/p cls mmr%=inp(&h21) ?"mask register"=hex$ (mmr%) ?"isr="isr% ?"irr="irr% dim p1 as dword ptr, p2 as dword ptr ,p3 as dword ptr p3=codeptr32(x) REM swap vectors p1=codeptr32(test)+1 :'exit from my interrupt routine p2=&h0000003c :'vector to intercept..int7 @[email protected] :rem point my exit to old irq vector !cli @p2=codeptr32(start) :rem point irq vector at my start out &h21,mmr% and &h7f :rem enable int7 !mov al,&h67 ;clear pending 1nt7 if any !out &h20,al !sti @p3=0 :rem init counter rem during this loop the interrupts can be seen to be working as the counter @p3 increments do [email protected] loop until instat !cli @[email protected] :rem put irq vector back out &h21,mmr% or &h80 :rem disable int7 !sti ?"finished" end rem the interrupt routine start: !pushf ;save flags !push ax ;save ax !inc word x ;counter to let me see it's working !mov al,255 ;pulse port 128 to trigger scope !out 128,al !mov al,0 !out 128,al !mov al,&h67 ;clear pending int7 !out &h20,al !pop ax ;restore ax !popf ;restore flags test: !jmp far test ;leave via original int7 vector !nop !nop !nop !nop !nop !nop !nop !nop x: !dd 0 end function irr% REM read the interrupr request register rem get irr out &h20,&h0a irr%=inp(&h20) END function Function isr% REM read the interrupt being serviced register rem get isr out &h20,&h0b isr%=inp(&h20) end function
Leave a comment: