IO口的碎碎念。(说实在的不是太多)
8259的中断控制寄存器口地址:
20h,中断命令寄存器
外部中断结束后,该口可发送中断结束信号,指令为:
mov al,20h
out 20h,al
21h,中断屏敝寄存器
这寄存器口8位对应外中断8个源,为0中断。
8255可编程外围接口
多配置方法,常用IO口为 60h,61h,62h, PA,PB,PC 键盘扬声器配置开关,这个接口要看电路芯片图纸。常用这个中断芯片是通用的接法。
63h,是命令寄存器,通过63h输入。系统在启动时间向63h口发送99h,设置PA,PC,为输入(一般电脑,有时会不同)
7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | | | | | | | |___\ 定时器中断 | | | | | | |_______\ 键盘中断 | | | | | |___________\ 保留 | | | | |_______________\ 异步通信口2 | | | |___________________\ 异步通信口1 | | |_______________________\ 硬盘中断 | |___________________________\ 软盘中断 |_______________________________\ 并行打印机 中断屏蔽寄存器位定义 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ ---+--- ---+--- -----+----- |___\ 0*二进制: 1*二-十进制 | | |___________\ 工作方式:000*方式0 011*方式3 | | 001*方式1 100*方式4 | | 010*方式2 101*方式5 | |_____________________\ 读写方式: 00*锁定当前计数值 |_____\ 编程通信号: 00*编程通道0 01*计数器低八位(LSB)有效 01*编程通道1 10*计数器高八痊(MSB)有效 10*编程通道2 11*先读写LSB,后读写MSB 8253命令寄存器定义 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | ---+--- | | | | |______\ PC口低端: 1=输入, 0=输出 | | | | | |__________\ PB口: 1*输入, 0*输出 | | | | |______________\ 方式: 0*方式0(基本方式), 1*方式1 | | | |__________________\ PC高端: 1*输入, 0*输出 | | |______________________\ PA口: 1*输入, 0*输出 | |____________________________\ 方式选择: 00*方式0(基本方式) | 01*方式1 | 10*方式2 |__________________________________\ 置方式: 1*有效, 0*无效 8255命令寄存器(63H 口)位定义 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ +- | | | | | | | | | 若PB口位7=0,则PA口的值为键盘扫描码 | +---+---+---+---+---+---+---+---+ PA口-| 7 6 5 4 3 2 1 0 (60h)| +---+---+---+---+---+---+---+---+ +- | | | | | | | | | 若PB口位7=1,则第0-7位分别表示开关1 +---+---+---+---+---+---+---+---+ 的各位:SW1-1,SW1-2,...,SW1-8. ---+--- ---+--- ---+--- | |_________\ 为0表示无磁盘驱动器 | | | |_____________\ 保留 | | |___________________\ 系统板上的RAM容量 | |___________________________\ 显示器类型 |___________________________________\ 磁盘驱动器个数 8255PA口位定义 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | | | | | | | | | PB口 +---+---+---+---+---+---+---+---+ (61h) | | | | | | | | | | | | | | | |_________\ 1*定时器门2 | | | | | | |_____________\ 1*扬声器数据 | | | | | |_________________\ 1*读SW2-1~SW2-4, | | | | |_____________________\ SW2-4 SW2-8 | | | |_________________________\ 盒带数据输入 | | |_____________________________\ 定时器2输出 | |_________________________________\ 1*扩充槽检查错 |_____________________________________\ 1*奇偶错 8255PB口位定义 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | | | | | | | | | PC口 +---+---+---+---+---+---+---+---+ 若PB口位2*1 若PB口位2*0 (62h) | | | | | | | | | | | | | | | |_________\ SW2-1 SW2-5 | | | | | | |_____________\ SW2-2 SW2-6 | | | | | |_________________\ SW2-3 SW2-7 备用 | | | | |_____________________\ SW2-4 SW2-8 | | | |_________________________\ 盒带数据输入 | | |_____________________________\ 定时器2输出 | |_________________________________\ 1*扩充槽检查错 |_____________________________________\ 1*奇偶错 8255PC口位定义
6845 CRT 寄存器口地址说明表 数据寄存器(3D5h)说明表
+------+-----------------+ +----------+--------+------------------+ | 地址 | 寄存器名称 | |寄存器地址|寄存器号| 功 能 | +------+-----------------+ +----------+--------+------------------+ | 3D4h | 索引寄存器 | | 0-3 | R0-R3 |水平特性参数寄存器| +------+-----------------+ +----------+--------+------------------+ | 3D5h | 数据寄存器 | | 4-9 | R4-R9 |垂直特性参数寄存器| +------+-----------------+ +----------+--------+------------------+ | 3D8h | 方式控制寄存器 | | A | R10 |光标起始行寄存器 | +------+-----------------+ +----------+--------+------------------+ | 3D9h | 颜色选择寄存器 | | B | R11 |光标终止行寄存器 | +------+-----------------+ +----------+--------+------------------+ | 3DAh | 状态寄存器 | | C | R12 |起始地址(高)寄存器| +------+-----------------+ +----------+--------+------------------+ | D | R13 |起始地址(低)寄存器| +----------+--------+------------------+ 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | X | X | | | | | | | +---+---+---+---+---+---+---+---+ 若PB口位2*1 若PB口位2*0 ______ | | | | | | | | | | | | |_________\ 1*80X25字符方式, 0=40X25字符方式 v | | | | |_____________\ 1*320X200图象方式, 0=选择字符方式 未使用 | | | |_________________\ 1*选择黑白方式, 0=选择彩色方式 | | |_____________________\ 1*开放视频信号, 0=改变方式时应关闭 | | 视频信号. | |_________________________\ 1*选择640X200黑白图像方式 |_____________________________\ 1*字符背景闪烁 方式选择寄存器3D8h 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ | X | X | X | BL| I | R | G | B | | X | X | X | X | | | | | +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ -----+----- | ------+------- -----+------- | | | |_____\ 允许显示 | | | | | | |_________\ 光笔触发器置位 v | v v | |_____________\ 光笔开关接通 未用 V 屏幕边缘颜色 未用 |_________________\ 垂直同步 字符属性的背景颜色强度位 选色寄存器3D9h 状态寄存器3DAh