Codes about 8259A are :(from Christopher Giese,a bit changed)
mov al,0x11 ; icw1-->11:icw4 is needed
out 0x20,al
out 0xa0,al
mov al,0x20 ; icw2:vector for IRQs begining
out 0x21,al ; IRQ0-IRQ7 -> interrupts 0x20-0x27
add al,8
out 0xa1,al
mov al,4 ; icw3
out 0x21,al
mov al,2
out 0xa1,al
mov al,1fh ; icw4
out 0x21,al
mov al,1bh
out 0xa1,al
mov al,0xFc ;ocw
out 0x21,al
and Codes for INT 21:
int_21:
mov si,msg_int20 ; 'Pressed key...'
inc dh ;dh->row for display
call Print ;routine for video output,param with dx & si.
in al,60h
iretd
when I press a key, it display the message twice, like this:
Pressed key...
Pressed key...
and it was no responds when press again.
thanks.
user4
prob about 8259A reprog , pls come in
Re: prob about 8259A reprog , pls come in
you get two messages because key down + key release each generate one.
so
a) press key down -> msg1
b) release the key -> msg2
so
a) press key down -> msg1
b) release the key -> msg2
Re: prob about 8259A reprog , pls come in
and you need to signal EOI, which your interrupt handler does not do.
Re: prob about 8259A reprog , pls come in
thanks.
>a) press key down -> msg1
>b) release the key -> msg2
but the message is in wrong position,why?
>and you need to signal EOI, which your interrupt handler does not do.
I think ICW4 above which equal 1fh means Automatic EOI.
When I add codes to signal EOI to the end of INT21,and change ICW4 to manual EOI,things are not changed. It always display the message twice,and no responds after that.
Merry Christmas for all.
>a) press key down -> msg1
>b) release the key -> msg2
but the message is in wrong position,why?
>and you need to signal EOI, which your interrupt handler does not do.
I think ICW4 above which equal 1fh means Automatic EOI.
When I add codes to signal EOI to the end of INT21,and change ICW4 to manual EOI,things are not changed. It always display the message twice,and no responds after that.
Merry Christmas for all.