OpenCores
URL https://opencores.org/ocsvn/rf6809/rf6809/trunk

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [boot/] [timer.asm] - Diff between revs 9 and 21

Show entire file | Details | Blame | View Log

Rev 9 Rev 21
Line 29... Line 29...
        sta             VIA+VIA_T3CMPH
        sta             VIA+VIA_T3CMPH
        clr             VIA+VIA_T3LL
        clr             VIA+VIA_T3LL
        clr             VIA+VIA_T3LH
        clr             VIA+VIA_T3LH
        lda             VIA+VIA_ACR                     ; set continuous mode for timer
        lda             VIA+VIA_ACR                     ; set continuous mode for timer
        ora             #$100
        ora             #$100
        sta             VIA+VIA_ACR                     ; enable timer #3 interrupts
        sta             VIA+VIA_ACR
        lda             #$810
        lda             #$880                                           ; enable timer #3 interrupts
        sta             VIA+VIA_IER
        sta             VIA+VIA_IER
        rts
        rts
 
 
TimerIRQ:
TimerIRQ:
        ; Reset the edge sense circuit in the PIC
        ; Reset the edge sense circuit in the PIC
        lda             #31                                                     ; Timer is IRQ #31
        lda             #31                                                     ; Timer is IRQ #31
        sta             IrqSource               ; stuff a byte indicating the IRQ source for PEEK()
 
        sta             PIC+16                                  ; register 16 is edge sense reset reg
        sta             PIC+16                                  ; register 16 is edge sense reset reg
        lda             VIA+VIA_IFR
        lda             PIC+$FF                                 ; Timer active interrupt flag
        bpl             notTimerIRQ
 
        bita    #$800
 
        beq             notTimerIRQ
        beq             notTimerIRQ
        clr             VIA+VIA_T3LL
        clr             PIC+$FF                                 ; clear the flag
 
        lda             #31                                                     ; Timer is IRQ #31
 
        sta             IrqSource               ; stuff a byte indicating the IRQ source for PEEK()
 
        clr             VIA+VIA_T3LL            ; should clear the interrupt
        clr             VIA+VIA_T3LH
        clr             VIA+VIA_T3LH
        inc             $E00037                                 ; update timer IRQ screen flag
        lda             #31                                                     ; Timer is IRQ #31
 
        sta             PIC+16                                  ; register 16 is edge sense reset reg
 
        clr             PIC+$FF                                 ; clear the flag
 
        inc             $E0003F                                 ; update timer IRQ screen flag
 
        ldd             milliseconds+2
 
        addd    #10
 
        std             milliseconds+2
 
        ldd             milliseconds
 
        adcb    #0
 
        stb             milliseconds+1
 
        adca    #0
 
        sta             milliseconds
 
 
 
        ; Update XModem timer, we just always do it rather than testing if XModem
 
        ; is active. The increment is set to give approximately 3s before the MSB
 
        ; gets set.
 
        ldb             xm_timer
 
        addb    #4
 
        stb             xm_timer
notTimerIRQ:
notTimerIRQ:
        rts
        rts
 
 
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.