*-----------------------------------------------------------------------------
* Timer ISR Test
*-----------------------------------------------------------------------------
                INCLUDE BIOS_IF.asm

                ORG     $10000
                MOVEA.L #$10000, A5

                MOVE.B  #$55, (DATA_BYTE, A5)
                MOVE.B  #$70, (DUART_ACR).W
                MOVE.B  #$70, (DUART_CTUR).W
                MOVE.B  #$00, (DUART_CTLR).W
                ENABLE_ISR CTRRDY_INT_BIT, COUNTER_ISR
*                MOVE.B  (DUART_START_CNTR).W, D0

LOOP1           GETC
                TST.B   D2
                BEQ.S   LOOP1

                CMPI.B  #13, D2
                BEQ.S   LOOP2

                PUTC
                BRA.S   LOOP1

LOOP2           DISABLE_ISR CTRRDY_INT_BIT
                RTS

COUNTER_ISR     MOVE.B  (DUART_STOP_CNTR).W, D0
                MOVE.B  (DATA_BYTE, A5), D0
                MOVE.B  D0, (DUART_SOPR).W
                NOT.B   D0
                MOVE.B  D0, (DUART_ROPR).W
                MOVE.B  D0, (DATA_BYTE, A5)
                RTS

DATA_BYTE       DS      1
