*-----------------------------------------------------------------------------
* Console I/O Tests
*-----------------------------------------------------------------------------
                include BIOS_IF.asm

BUFFER_SIZE     EQU     100
ASCII_CR        EQU     13

                ORG     $10000

                MOVEA.L #HEADER_MSG, A2
                PUTS

LOOP1           GETC
                TST.B   D2
                BEQ.S   LOOP1

                PUTC
                CMP.B   #ASCII_CR, D2
                BNE.S   LOOP1

LOOP2           MOVEA.L #BUFFER, A2
                MOVE.W  #BUFFER_SIZE, D4
                GETS

                TST.B   (BUFFER).L
                BEQ.S   EXIT

                MOVEA.L #BUFFER, A2
                PUTS
                BRA.S   LOOP2

EXIT            MOVE.L  #$12345678, D4
                MOVE.W  #4, D5
                PRINT_HEX
                RTS

HEADER_MSG      DB    "Sample App", ASCII_CR, 0
BUFFER          DS    BUFFER_SIZE
