汇编语言 中断程序代码

来源:百度知道 编辑:UC知道 时间:2024/06/29 01:03:52
编写一个中断处理程序,要求在主程序运行过程中,每隔10秒响铃一次,同时在屏幕上显示信息“The bell is ring”。

还是找到了以前写的,拿分来
;***************************
;purpose:ring and display a message every 10 seconds
;***************************
.model small
.stack 100h
.data
count dw 1
msg db 'The bell is ringing!',0dh,0ah,'$'
.code
main proc far
start:
mov ax,@data
mov ds,ax
mov al,1ch
mov ah,35h ;get interrupt vector
int 21h
push es
push bx
push ds

mov dx,offset ring
mov ax,seg ring
mov ds,ax
mov al,1ch
mov ah,25h
int 21h

pop ds
in al,21h
and al,11111110b
out 21h,al
sti
mov di,2000
delay:
mov si,3000
delay1:
dec si
jnz delay

pop dx
pop ds
mov al,1ch
mov ah,25h
int 21h
mov ah,4ch
int 21h
main endp
;---------------------
;purpose:ring every 10 seconds when substituted for interrupt 1ch
ring proc near
push ds
push ax
push