回 帖 发 新 帖 刷新版面

主题:汇编的中断程序,大哥大姐帮忙看看

data  segment
count dw 1
msg   db 'The bell is ringing!',0dh,0ah,'$'
data  ends
;
code  segment
main  proc far
      assume cs:code,ds:data
start:
      push ds
      xor  ax,ax
      push ax
      mov ax,data
      mov ds,ax
      mov al,1ch
      mov ah,35h
      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,20000
delay:mov si,30000
delay1:dec si
       jnz delay1
       dec di
       jnz delay
       pop dx
       pop ds
       mov al,1ch
       mov ah,25h
       int 21h

       mov ax,4c00h
       int 21h
       ret
main   endp
;
ring   proc near
       push ds
       push ax
       push cx
       push dx
       mov ax,data
       mov ds,ax
       sti

       dec count
       jnz exit
       mov dx,offset msg
       mov ah,09h
       int 21h

       mov dx,100
       in  al,61h
       and al,0fch
sound:
       xor al,02
       out 61h,al
       mov cx,1400h
wait1: loop wait1
       dec  dx
       jnz sound
       mov count,182
exit:  cli
       pop dx
       pop cx
       pop ax
       pop ds
       iret
ring   endp
code   ends
       end start

这个程序是实现 每10秒钟发声一次,并且同时显示"the bell is ringning! "
可是我一直都实现不了
改的是时钟端口1ch的中断向量
请帮忙看看
编译可以通过, debug 时就会发生错误

回复列表 (共1个回复)

沙发

不能够DEBUG,涉及到中断的,最好不要用DEBUG,更何况程序不是很长,慢慢检查就是了,好像这个程序我在哪本书上看到过!

我来回复

您尚未登录,请登录后再回复。点此登录或注册