《微机原理与接口》第5章中断系统.ppt

《微机原理与接口》第5章中断系统

设置中断向量 cli push ds mov dx,offset new08h mov ax,seg new08h mov ds,ax mov ax,2508h int 21h pop ds 例5.16 设置中断寄存器 in al,21h push ax and al,0feh ;允许IRQ0 out 21h,al mov counter,0 ;设置中断次数初值 sti ;开中断 例5.16 循环等待中断 start1: cmp counter,10 jb start1 ;中断10次退出 例5.16 中断就在主程序循环当中 进入中断服务程序 new08h proc sti ;开中断 push ax ;保护寄存器 push bx push ds mov ax,@data mov ds,ax ;设置数据段DS 例5.16 中断处理 inc counter mov si,offset intmsg ;显示信息 call dpstri 例5.16 显示字符串 dpstri proc ;显示字符串子程序 push ax push bx dps1: lodsb cmp al,0 jz dps2 例5.16 显示字符串(续) mov bx,0 mov ah,0eh

文档评论(0)

1亿VIP精品文档

相关文档