; $Id: simple_echo.mac 504 2013-04-13 15:37:24Z mueller $
;
; simple echo test for DL11 interface
;
        RCSR = 177560
        RBUF = 177562
        XCSR = 177564
        XBUF = 177566
;
        CR = 015
        LF = 012
;
; transfer vector
;
        .asect
        . = 200
        jmp     start
;
; test code
;
        . = 1000
;
start:  mov     #start,sp
;
1$:     tstb    @#RCSR          ; input ready ?
        bpl     1$              ; if not poll
        movb    @#RBUF,r0       ; get input char
2$:     tstb    @#XCSR          ; output ready ?
        bpl     2$              ; if not poll
        movb    r0,@#XBUF       ; echo received char
        cmpb    #CR,r0          ; was it CR ?
        bne     1$              ; if not, wait for next input
3$:     tstb    @#XCSR          ; output ready ?
        bpl     3$
        movb    #LF,@#XBUF      ; send LF
        br      1$
;
        .end
