From 703069b467329c8c27c06e62ad61b915e9079ac6 Mon Sep 17 00:00:00 2001 From: p6a8nelzg <1973393745@qq.com> Date: Fri, 1 Jul 2022 11:10:50 +0800 Subject: [PATCH] ADD file via upload --- mouse.S | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 mouse.S diff --git a/mouse.S b/mouse.S new file mode 100644 index 0000000..03c0aaa --- /dev/null +++ b/mouse.S @@ -0,0 +1,52 @@ +#include +.globl mouse_interrupt +mouse_interrupt: + pushl %eax + pushl %ebx + pushl %ecx + pushl %edx + + push %ds + movl $0x10,%eax + mov %ax,%ds #为后面的call做准备 + + #inb %ax,%ds + #call readmouse #调用c函数进行细致处理 + +#鼠标对应数据寄存器端口是$0x60,通过inb命令将该数据寄存器中 +#存放的一个字节信息读入到寄存器AL中, +#用户对鼠标的全部信息包含在这一个字节的数据编码里 +xor %eax,%eax + inb $0x60,%al + pushl %eax + call readmouse + addl $4,%esp + +xor %eax,%eax + inb $0x60,%al + pushl %eax + call readmouse + addl $4,%esp + +xor %eax,%eax + inb $0x60,%al #读入鼠标数据 + pushl %eax + call readmouse + addl $4,%esp + +xor %eax,%eax + inb $0x60,%al + pushl %eax + call readmouse + addl $4,%esp +#在mouse_interupt 处理完中断以后,给8259A发送结束中断(EOI)指令 + movb $0x20,%al + outb %al,$0xA0 + outb %al,$0x20 + + pop %ds + popl %edx + popl %ecx + popl %ebx + popl %eax + iret \ No newline at end of file