中断体验:观察自定义中断的安装及触发
2017-05-18 08:39
232 查看
【说明】中断机制是一种重要的解决问题的手段。针对初学者不能对中断的相关技术有直观的认识,特设计了这个学习活动。
【知识准备】中断向量表;中断处理过程;中断安装程序
【体验步骤】
步骤1 自定义78h号中断的中断处理例程,并将其安装到内存中
编译、连接及运行过程如下:
请说出来:运行以后什么也看到,程序的作用是什么?
步骤2 编程序,触发中断78h
编译、连接、运行程序:
请说出:在运行pa时,发生了什么?为什么?
步骤3 在debug中载入pa.exe并单步运行,观察寄存器的变化
重点关注:CS、IP,以及标志寄存器中IF的值,如图,EI(允许)或DI(关闭)
一边观察,一边说出运行中涉及的中断的机制
步骤4 在debug中调用int 78h
按下面操作工作:
请说出,调用int 78时发生了什么?
步骤5:关闭DOSBOX,再打开,不做步骤1,直接从步骤2开始重做上面的工作。
请说出:你看到了什么?为什么会是这样?
【知识准备】中断向量表;中断处理过程;中断安装程序
【体验步骤】
步骤1 自定义78h号中断的中断处理例程,并将其安装到内存中
;文件名: ptest.asm assume cs:code code segment start:mov ax,cs mov ds,ax mov ax,0 mov es,ax ;安装中断例程 lea si, do_78h mov di,200h mov cx,offset do78h_end - offset do_78h cld rep movsb ;设置中断向量表 mov word ptr es:[78h*4],200h mov word ptr es:[78h*4+2],0 mov ax,4c00h int 21h ;定义中断例程:显示"flying"; do_78h: jmp short istart msg db 'flying!-Piao Guo....' istart: push ds push es push si push di push ax push cx mov ax, cs mov ds, ax mov si, 202h mov ax,0b800h mov es,ax mov di,160*24 mov ah, 11001111b ;闪烁红底加亮白字 mov cx,offset istart - offset msg s: mov al,[si] mov es:[di],ax ;字符与属性一起移入 inc si add di,2 loop s pop cx pop ax pop di pop si pop es pop ds iret do78h_end:nop code ends end start
编译、连接及运行过程如下:
请说出来:运行以后什么也看到,程序的作用是什么?
步骤2 编程序,触发中断78h
;文件名: pa.asm assume cs:code, ss:stack stack segment stack db 16 dup (0) stack ends code segment start: int 78h mov ax,4c00h int 21h code ends end start
编译、连接、运行程序:
请说出:在运行pa时,发生了什么?为什么?
步骤3 在debug中载入pa.exe并单步运行,观察寄存器的变化
重点关注:CS、IP,以及标志寄存器中IF的值,如图,EI(允许)或DI(关闭)
一边观察,一边说出运行中涉及的中断的机制
步骤4 在debug中调用int 78h
按下面操作工作:
请说出,调用int 78时发生了什么?
步骤5:关闭DOSBOX,再打开,不做步骤1,直接从步骤2开始重做上面的工作。
请说出:你看到了什么?为什么会是这样?
相关文章推荐
- Zynq 自定义模块中断触发实例
- Zynq 自定义模块中断触发实例
- Zynq 自定义模块中断触发实例
- 项目打包时自定义安装属性,如数据库名等
- VS2005中建立自定义数据观察器
- Linux 2.6内核编译安装全景体验(中)
- 自定义安装程序
- InstallshieldX安装制作杂记(实例之自定义对话框)
- 体验:VC++ .NET 2003 –安装和使用Boost 1.30和Blitz++0.6 之一
- 在Windows CE增加自定义中断处理
- 安装VSTS之体验
- 体验:VC++ .NET 2003 –安装和使用STLport 4.5.3 和LokiPort
- (转载)自定义 MSI 安装
- office 2007安装----简单试用体验
- 利用ASP.NET2.0向导控件一步步建立与用户的交互--------提高和自定义用户体验
- Linux 2.6内核编译安装全景体验(下)
- 项目打包时自定义安装属性,如数据库名等
- 最新ColdFusion MX 7(Blackstone)安装体验
- FC4初步使用体验--fox进行更新,添加官方安装指南
- 自定义MSI 安装