中断信号仅由 RTC 发送一次

The interrupt signal is transmitted only once by the RTC

RTC + CMOS(实时时钟)有一个小问题,更确切地说是摩托罗拉 MC146818A。 该程序执行的任务是以等于 1 秒的固定时间间隔显示字母“A”。所以我正确设置了寄存器A和寄存器B的位,事实是我截获的子程序只被激活一次,我不明白为什么。这是代码:

这是函数的模块:

_text SEGMENT PARA PUBLIC 
    
  farjmp  09C0h, _start

  times    db     0h 

 mount_rtc_subroutine PROC NEAR 

    push    ax
    push    es 

    xor     ax, ax 
    mov     es, ax 

    ;I mask the line of break n0 of the slave PIC
    in      al, 0A1h 
    or      al, 01h 
    out     0A1h, al

    ;memorize in the IVT the SEG: OFF components of the 
    ;first instruction of my service subroutine
    mov     WORD PTR es:[1C0h], _rtc_subroutine 
    mov     WORD PTR es:[1C2h], 09C0h 

    mov     al, 0Ah 
    out     70h, al 
    mov     al, 2Fh 
    out     71h, al

    mov     al, 0Bh 
    out     70h, al 
    mov     al,  42h 
    out     71h, al 

    ;active the break line n0 of the slave PIC 
    in      al, 0A1h 
    and     al, 0FEh
    out     0A1h, al

    pop     es 
    pop     ax 
    ret

 mount_rtc_subroutine ENDP 

_rtc_subroutine:
   push    ax
   push    bx

   mov     bx, OFFSET times 

   cmp     BYTE PTR [bx], 0h 
   jne     _write

   inc    BYTE PTR [bx]
   jmp     _EOI 

   _write: mov     ax, 0F41h 
           stosw
           mov    WORD PTR [bx], 0h

   _EOI: mov     al, 20h 
         out     0A0h, al 
         out     20h, al 

   pop     bx
   pop     ax
   iret    

_text ENDS 

主模块:

farjmp MACRO segm, off

   db  0EAh
   dw  off
   dw  segm

ENDM 

INCLUDE rtc_sub

_text SEGMENT PARA PUBLIC 

_start:
    mov    ax, 09C0h  
    mov    ds, ax 
    mov    ss, ax
    mov    sp, 0FFFFh 
    mov    ax, 0B800h
    mov    es, ax 

    call   mount_rtc_subroutine

    jmp $

_text ENDS 
     END _start

我没有发现任何问题,但确实存在。 你觉得问题是什么?

问题是在服务子程序结束时未能读取RTC的寄存器C,这样RTC就不允许发送任何隐蔽的中断信号,从而导致中断不激活经理。

添加此说明:

mov  al, 0Ch
out  70h, al
in   al, 71h