Code: Select all
INT_0xC: ;COM1 (Serial Mouse) Interrupt Called.
sti
push dx
push ax
push si
push cs
pop ds
mov si, mouse
call Print_String ;Write a "M"
mov al,0x20 ;Make the interrupt vector happy, and
out 0x20,al ;tell it this interrupt is done with its job ;-)
pop si
pop ax
pop dx
IRET
Here is the initialization code for the serial:
Code: Select all
mouse2:
mov si,0x3f8
mov dx,si ;SET DLAB ON
add dx,3
mov al,0x80
out dx,al
nop
mov dx,si ;set Baud rate (low)
mov al,0x60
out dx,al
nop
;/* Default 0x03 = 38,400 BPS */
;/* 0x01 = 115,200 BPS */
;/* 0x02 = 57,600 BPS */
;/* 0x06 = 19,200 BPS */
;/* 0x0C = 9,600 BPS */
;/* 0x18 = 4,800 BPS */
;/* 0x30 = 2,400 BPS */
;/* 0x60 = 1,200 BPS */
mov dx,si ;set Baud rate (high)
inc dx
mov al,0
out dx,al
nop
mov dx,si ;8 Bits, No Parity, 1 Stop Bit
add dx,3
mov al,0x3
out dx,al
nop
mov dx,si ;FIFO Control Register
add dx,4
mov al,0xb
out dx,al
nop
mov dx,si ;Turn on DTR, RTS, and OUT2
add dx,2
mov al,0xc7
out dx,al
nop
mov dx,si ;Interrupt when data received
inc dx
mov al,1
out dx,al
nop