自定义0号中断
来源:互联网 发布:铁甲衣 知乎 编辑:程序博客网 时间:2024/05/20 07:18
调试了好久才得到想要的结果,分享下:
assume cs:codesg
codesg segment
; move the code to the 0:200
start: mov ax,cs
mov ds,ax ; source segment in the cs segment
mov si,offset d0
mov ax,0
mov es,ax
mov di,200h ; di can be assign a value directly
mov cx, offset d0end - offset d0
cld
rep movsb
; set the interupt table
mov ax,0
mov es,ax
mov word ptr es:[0*4],200h
mov word ptr es:[0*4+2],0
mov ax,4c00h
int 21h
d0: jmp short d0start
db "Divid Overflow!"
d0start:mov ax,cs
mov ds,ax
mov si,202h ; si point to the 'Divid Overflow!'
mov bx,0b800h
mov es,bx
mov di,160*12+33*2 ; di point to the video memory
mov cx,15
s: mov ax,[si]
mov ah,02
mov es:[di],ax
inc si
add di,2
loop s
mov ax,4c00h
int 21h
d0end: nop
codesg ends
end start
NOTE:
1.用到[寄存器]取数据的时候,最好源用si(source) 目的用si(destination)这样在使用时候不容易混淆源和目的的指针。
2.在显示的时候是12*160+33*2(显示在第十二行33列),写的时候要清楚含义。
- 自定义0号中断
- 【汇编】自定义9号中断(键盘输入处理中断)
- 【汇编】自定义9号中断(键盘输入处理中断)
- ASM_6自定义中断[代码]
- ASM_6自定义中断[概念]
- TMS320F28335之外部中断和自定义中断
- 汇编语言自定义int9中断程序
- 【汇编】重写0号中断(除法溢出中断)
- 第一个DOS中断处理程序(中断号为0)
- 除法错误中断(0号中断)的编写
- 模拟0号中断程序
- 修改0号中断程序
- 中断号
- 中断号与中断地址
- 中断源和中断号
- 中断向量和中断号
- 中断体验:观察自定义中断的安装及触发
- 在Windows CE增加自定义中断处理
- “集群和负载均衡”等的通俗解释
- javascript 基础回顾
- 水货iPad 2功能有什么缺陷吗,能使用大陆3G网络吗?
- 餐饮经营思考(四)——市场调研
- LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
- 自定义0号中断
- 【小蒙淘金】12.16周评-黄金白银下周走势分析及部分操作建议
- iOS 第三方类库FMDB的使用
- 关于PHP的魔术引号
- linux 修改代码以支持LED 控制(board-am335xevm)
- Win7下的免费ssh和ftp工具
- Struts2请求处理流程
- 北大青鸟ASP.NET——基础
- Django 模板编辑器Eclipse插件 - Django Editor