START   LDI     R1, KBSR    ; Test for character input
        BRzp    START
        LDI     R0, KBDR
ECHO    LDI     R1, CRTSR   ; Test output register ready
        BRzp    ECHO
        STI     R0, CRTDR
        BR      NEXT_TASK
KBSR    .FILL   xF400       ; Address of KBSR
KBDR    .FILL   xF401       ; Address of KBDR
CRTSR   .FILL   xF3FC       ; Address of CRTSR
CRTDR   .FILL   xF3FF       ; Address of CRTDR