        .blkw   100
        .globl  chess,output
start:  mov     #start,sp
        jsr     pc,getdig
        ash     #3,r0
        mov     r0,pos
        jsr     pc,getdig
        bis     r0,pos
        mov     #brett,-(sp)
        mov     #pos,-(sp)
        jsr     pc,chess
        add     #4,sp
        mov     #8.,r0
        mov     #brett,r1
loop1:  mov     #8.,r2
        mov     #string,r3
loop2:  movb    (r1)+,(r3)+
        sob     r2,loop2
        mov     r3,-(sp)
        mov     r2,-(sp)
        mov     r1,-(sp)
        mov     r0,-(sp)
        mov     #string,-(sp)
        jsr     pc,output
        add     #2,sp
        mov     (sp)+,r0
        mov     (sp)+,r1
        mov     (sp)+,r2
        mov     (sp)+,r3
        sob     r0,loop1
        halt
getdig: tstb    177561
        bpl     getdig
        movb    177563,r0
        sub     #'0,r0
        rts     pc
brett:  .blkb   64.
pos:    .word   34
string: .blkb   8.
        .byte   13.,10.,0
        .end    start
