/ B library -- putchar .globl .putcha, .flush, .fout .globl n7, n11 .putcha: .+2 .+2 mov r4,r5 cmp (r5)+,(r5)+ mov (r5)+,ch / get character mov .fout,r0 / get default fd tstb ch+1 / check if one or two chars beq 1f / one char swab ch / two chars sys write; ch; 2 br 2f 1: sys write; ch; 1 2: jmp n7 / return with value? .flush: .+2 n11 ch: 0 .fout: 1