rtc_off proc near
;disables the real time clock periodic timer

        push    ax
        cli
        mov     al, 0bh
        out     70h, al
        in      al, 71h
        mov     ah, al          
        and     ah, NOT BIT6    ; turn off BIT 6 in CMOS status register 0Bh
        mov     al, 0bh         ; which generates IRQ 8 to call INT 70
        out     70h, al
        mov     al, ah
        out     71h, al

        mov     al, 20h         ; signal end of interrupt
        out     20h, al
        out     0a0h, al
        sti
        pop     ax
        ret
rtc_off endp

;=======================================================================
;RTC timer stuff to throttle back CPU.
;
;
slowdown_cpu    proc    near

        push    ax        
        cli
        mov     al, 0ah
        out     70h, al
        in      al, 71h
        and     al, 0f0h
        or      al, 1010b        ; set rate of 500 millisecs rate
        mov     ah, al
        mov     al, 0ah
        out     70h, al
        mov     al, ah
        out     71h, al


        mov     al, 0bh
        out     70h, al
        in      al, 71h
        mov     ah, al
        or      ah, BIT6         ; turn on BIT 6 in CMOS status register 0Bh
        mov     al, 0bh          ; which generates IRQ 8 to call INT 70
        out     70h, al          
        mov     al, ah
        out     71h, al


        ; make sure PIC A1 register isn't masking interrupt

        in      al, 0a1h          
        and     al, 0FEh
        out     0a1h, al
        sti
        pop     ax
        ret
        
slowdown_cpu    endp

