                  INCLUDE BIOS_IF.asm
                  ORG   APP_START

                  PUTS  HEADER_MSG

                  LD    A, 55H
                  LD    (DATA_BYTE), A
                  LD    A, 70H
                  OUT   (DUART_ACR), A
                  LD    A, 70H
                  OUT   (DUART_CTUR), A
                  LD    A, 0
                  OUT   (DUART_CTLR), A

                  LINK_ISR CTRRDY_INT, TIMER_ISR
                  IN    A, (DUART_START_CNTR)

LOOP1             GETC
                  AND   A
                  JR    NZ, LOOP2
                  JR    LOOP1

LOOP2             LD    A, 0
                  OUT   (DUART_ACR), A
                  RET

HEADER_MSG        DB    "Timer Test", 13, 0

TIMER_ISR         IN    A, (DUART_STOP_CNTR)
                  LD    A, (DATA_BYTE)
                  OUT   (DUART_SOPR), A
                  XOR   0FFH
                  OUT   (DUART_ROPR), A
                  LD    (DATA_BYTE), A
                  RET

DATA_BYTE         DS    1
