M1      M2      M3      M4      M5      M6      üË,ô.óO^«ƒ«(I(.proc lib(.public host(.def disp,xbuf,setvdp,kscan(.def xmit,recv,functn,wricur,chcnt(.def scrcol,coltbl(.ref svcur,crut,crup  ;D I S P ******* disp    dect    r10(mov     r11,    *r10(mov     r5,     r0(bl      @setvdp $10     seto    @nocur          ;assume no cursor(movb    @rbuf(r2),      r0(inc     r2(andi    r2,     1Fh(movb    @escflg,@escflg(jeq     $15(bl      @esc(jmp     dend $15     cb      r0,     @cntlch(jh      $20(srl     r0,     8(bl      @cntrl(jmp     dend $20     cb      r0,     @del(jeq     dend(movb    r0,     *r14(clr     @nocur(movb    @wrapfl,@wrapfl(jne     $25(c       @chcnt, @endlin(jeq     $30 $25     inc     r5(inc     @chcnt(c       @chcnt, @linlen(jne     $30         clr     @chcnt $30     c       r5,     @vdpend(jeq     $40(c       r2,     r1(jne     $10(jmp     dend $40     bl      @scroll dend    mov     @nocur, r0(mov     *r10+,  r11(b       *r11  linlen  .word   28h endlin  .word   27h chcnt   .word   0 vdpend  .word   4BC0h nocur   .word escflg  .byte   0 cntlch  .byte   1Fh  ;C N T R L ***** cntrl   dect    r10(mov     r11,    *r10(ci      r0,     7(jl      cntlend $15     ci      r0,     1Bh(jne     $20(movb    @newch, @escflg(jmp     cntlend $20     ci      r0,     0Fh(jh      cntlend(li      r7,     7(s       r7,     r0(sla     r0,     1(mov     r0,     r7(b       @jmptbl(r7)( cntlend mov     *r10+,  r11(b       *r11( jmptbl  jmp     cntlend(jmp     bs(jmp     cntlend(jmp     lf(jmp     cntlend(jmp     cntlend(jmp     cr1(jmp     cntlend(jmp     cntlend(jmp     cntlend(jmp     cntlend(jmp     cntlend(jmp     cntlend  cr1     c       @chcnt, @zero(jeq     cntlend(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(clr     @nocur(s       @chcnt, r5(clr     @chcnt(jmp     cntlend  bs      bl      @escd(jmp     cntlend  lf      bl      @escb(jmp     cntlend  ;E S C A ******* esca    dect    r10(mov     r11,    *r10(ci      r5,     4828h(jl      $10(clr     @nocur(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(s       @linlen,r5 $10     mov     *r10+,  r11(b       *r11  ;E S C B ******* escb    dect    r10(mov     r11,    *r10(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(clr     @nocur(c       r5,     @lastln(jl      $10(bl      @scroll(a       @chcnt, r5(jmp     $20 $10     a       @linlen,r5 $20     mov     *r10+,  r11(b       *r11  ;E S C C ******* escc    dect    r10(mov     r11,    *r10(mov     @chcnt, r0(ci      r0,     27h(jeq     $10(clr     @nocur(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(inc     r5(inc     @chcnt $10     mov     *r10+,  r11(b       *r11  ;E S C D ******* escd    dect    r10(mov     r11,    *r10(c       @chcnt, @zero(jeq     $10(clr     @nocur(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(dec     r5(dec     @chcnt $10     mov     *r10+,  r11(b       *r11  ;E S C E ******* esce    dect    r10(mov     r11,    *r10(bl      esch(bl      escj(mov     *r10+,  r11(b       *r11  ;E S C H ******* esch    ci      r5,     4800h(jeq     $10(dect    r10(mov     r11,    *r10(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(mov     @vdpstr,r5(clr     @nocur(clr     @chcnt(mov     *r10+,  r11 $10     b       *r11  ;E S C J ******* escj    dect    r10(mov     r11,    *r10(mov     r5,     r6(mov     @chcnt, r7(s       r7,     r6(mov     r5,     r0 $10     bl      @setvdp(mov     @chcnt, r0 $20     movb    @newch, *r14(inc     r0(c       r0,     @linlen(jl      $20(clr     @chcnt(a       @linlen,r6(bl      @recv(mov     r6,     r0(ci      r0,     4BC0h(jl      $10(mov     r7,     @chcnt(clr     @nocur(mov     *r10+,  r11(b       *r11  ;E S C K ******* esck    dect    r10(mov     r11,    *r10(mov     r5,     r0 $10     bl      @setvdp(mov     @chcnt, r0 $20     movb    @newch, *r14(inc     r0(c       r0,     @linlen(jl      $20(clr     @nocur(mov     *r10+,  r11(b       *r11  ;E S C Y ******* escy    movb    r0,     @escflg(b       *r11  ;E S C Z ******* escz    li      r0,     1B2Fh(movb    r0,     @xbuf(r3)(inc     r3(andi    r3,     1Fh(swpb    r3(movb    r0,     @xbuf(r3)(inc     r3(andi    r3,     1Fh(li      r0,     4B00h(movb    r0,     @xbuf(r3)(inc     r3(andi    r3,     1Fh(b       *r11  ;E S C ********* esc     dect    r10(mov     r11,    *r10(cb      @escflg,@newch(jne     $30(clr     r6(movb    @zero,  @escflg $10     cb      r0,     @valesc(r6)(jeq     $20(inc     r6(ci      r6,     13(jne     $10(movb    @ech,   @rbuf(r1)(inc     r1(andi    r1,     1Fh(cb      r0,     @escch(jne     $15(movb    @ech,   r0 $15     movb    r0,     @rbuf(r1)(inc     r1(andi    r1,     1Fh(jmp     endesc  $20     mpy     @six,   r6  ;mult x 4(b       @etbl(r7)  $30     movb    @par1,  @par1(jne     $40(movb    r0,     @par1(jmp     endesc $40     movb    @zero,  @escflg(mov     r0,     r7(mov     @par1,  r6(movb    @zero,  @par1(srl     r6,     8(srl     r7,     8(li      r0,     32      ;zero relative(s       r0,     r6(s       r0,     r7(ci      r6,     23(jh      endesc(ci      r7,     39(jh      endesc(mov     r7,     @chcnt(mov     r5,     r0(bl      @setvdp(movb    @savech,*r14(mov     @vdpstr,r5(a       r7,     r5(mpy     @linlen,r6(a       r7,     r5(clr     @nocur  endesc  mov     *r10+,  r11         b       *r11( valesc  .ascii  'ABCDEFGHIJKLYZ' etbl    bl      @esca(jmp     endesc(bl      @escb(jmp     endesc(bl      @escc(jmp     endesc(bl      @escd(jmp     endesc(bl      @esce(jmp     endesc(bl      @endesc(jmp     endesc(bl      @endesc(jmp     endesc(bl      @esch(jmp     endesc(bl      @esca(jmp     endesc(bl      @escj(jmp     endesc(bl      @esck(jmp     endesc(bl      @endesc(jmp     endesc(bl      @escy(jmp     endesc(bl      @escz(jmp     endescpar1    .byte   0 six     .byte   6 escch   .byte   1Bh ech     .byte   5Bh  ;S C R O L L *** scroll  dect    r10(mov     r11,    *r10(li      r0,     0828h(mov     r0,     @scrptr(li      r7,     40(li      r5,     4800h $5      mov     @scrptr,r0(bl      @setvdp(clr     r6 $10     movb    *r15,   @linbuf(r6)(inc     r6(c       r6,     r7(jne     $10(a       r6,     r0(mov     r0,     @scrptr(mov     r5,     r0(bl      @setvdp(clr     r6 $20     movb    linbuf(r6),*r14(inc     r6(c       r6,     r7(jne     $20(a       r6,     r5(ci      r5,     4B98h(jeq     $30(bl      recv(jmp     $5 $30     clr     r6 $40     movb    @newch, *r14(inc     r6(c       r6,     r7(jne     $40(mov     *r10+,  r11(b       *r11( scrptr  .word    linbuf  .block  40  ;S E T V D P *** setvdp  swpb    r0(movb    r0,     @2(r14)(swpb    r0(movb    r0,     @2(r14)(b       *r11  ; K S C A N **** kscan   movb    @vdpr1, @83D4h(movb    @knum,  @8374h(lwpi    83E0h(mov     r11,    @RR11(bl      @000Eh(mov     @RR11,  r11(lwpi    8380h(clr     r0(cb      @837Ch, @newch(jne     $10(movb    @8375h, r0(cb      r0,     @badcr(jne     $10(movb    @cr,    r0(jmp     $30 $10     cb      r0,     @baddel(jne     $30(movb    @del,   r0 $30     b       *r11 RR11    .word vdpr1   .byte  0F0h knum    .byte   04 newch   .byte   20h cr      .byte   0Dh badcr   .byte   8Dh del     .byte   7Fh baddel  .byte   88h fill1   .byte  ;W R I C U R *** wricur  dect    r10(mov     r11,    *r10(mov     r5,     r0(andi    r0,     3FFFh(bl      @setvdp(movb    *r15,   @savech(clr     r0(movb    @savech,r0(srl     r0,     5(andi    r0,     3FFFh(bl      @setvdp(clr     r7 $10     movb    *r15,   @tmpcur(r7)(inc     r7(ci      r7,     8(jl      $10(clr     r7 $20     mov     @tmpcur(r7),r0(inv     r0(mov     r0,     @tmpcur(r7)(inct    r7(ci      r7,     8(jl      $20(li      r0,     4001h(bl      @setvdp(clr     r7(inc     r7 $30     movb    @tmpcur(r7),*r14(inc     r7(ci      r7,     8(jl      $30(mov     r5,     r0(bl      @setvdp(movb    @zero,  *r14(mov     *r10+,  r11(b       *r11 tmpcur  .block  8 savech  .byte fill2   .byte   0  ;X M I T ******* xmit    tb      22(jne     $10(movb    @xbuf(r4),      r0(mov     @host,  @host(jeq     $5(ci      r0,             0(jlt     $5(movb    r0,     @rbuf(r1)(inc     r1(andi    r1,     1Fh $5      andi    r0,     7FFFh(ldcr    r0,     8(inc     r4(andi    r4,     1Fh $10     b       *r11 xbuf    .block  32  ;R E C V ******* recv    tb      21(jne     $10(stcr    r0,     8(andi    r0,     7F40h(movb    r0,     @rbuf(r1)(sbz     18(mov     @host,  @host(jeq     $5(ori     r0,     8000h(movb    r0,     @xbuf(r3)(inc     r3(andi    r3,     1Fh $5      inc     r1(andi    r1,     1Fh $10     b       *r11 rbuf    .block  32  ;P R T S C R *** prtscr  li      r13,    0008h(movb    r13,    @2(r14)(swpb    r13(movb    r13,    @2(r14)(mov     @crup,  r12(clr     r0 $5      movb    *r15,   r7(movb    r7,     r7(jne     $6(movb    @savech,r7 $6      ci      r12,    1300h(jne     $10(bl      @pioprt(jmp     $15 $10     bl      @rsprt $15     inc     r13(inc     r0(ci      r0,     40(jne     $20         li      r7,     0D00h(ci      r12,    1300h(jne     $16(bl      @pioprt(jmp     $17 $16     bl      @rsprt $17     li      r7,     0A00h(ci      r12,    1300h(jne     $18(bl      @pioprt(jmp     $19 $18     bl      @rsprt $19     clr     r0 $20     ci      r13,    0BC0h(jne     $5(mov     @crut,  r12(mov     *r10+,  r11(b       *r11   rsprt   tb      22(jne     rsprt(ldcr    r7,     8(b       *r11  pioprt  tb      2(jeq     pioprt(sbo     0(sbz     1(movb    r7,     @5000h(sbz     2 $10     tb      2(jne     $10(sbo     2(sbo     1(sbz     0 $30     b       *r11  ;F U N C T N *** functn  dect    r10(mov     r11,    *r10(cb      r0,     @newcol(jne     $5(bl      @color(jmp     fend $5      cb      r0,     @prt(jne     $10(bl      @prtscr(jmp     fend $10     cb      r0,     @exitch(jeq     exit(cb      r0,     @xmxmit(jeq     exit(cb      r0,     @xmrecv(jeq     exit         cb      r0,     @wrap(jne     fend(swpb    @wrapfl fend    mov     *r10+,  r11(b       *r11  wrapfl  .word   0FF00h newcol  .byte  0B1h prt     .byte  0B2h exitch  .byte   85h xmxmit  .byte  0B5h xmrecv  .byte  0B6h wrap    .byte  0B4h  ;E X I T ******* exit    inct    r10(mov     r0,     r6(li      r0,     4000h(bl      @setvdp(clr     r7 $15     movb    @svcur(r7),*r14(inc     r7(ci      r7,     8(jl      $15(li      r12,    1F00h(sbo     0(inct    r10(mov     *r10+,  r11(mov     *r10+,  r12(mov     *r10+,  r13(mov     *r10+,  r14(mov     *r10,   r15(mov     r6,     r0(srl     r0,     8(mov     r0,     *r10(b       *r11  ;C O L O R ***** color   mov     @scrcol,        r7(movB    @coltbl(r7),    r13(movb    r13,            @2(r14)(li      r13,            8700h(movb    r13,            @2(r14)(inc     r7(ci      r7,             12(jl      $10(clr     r7 $10     mov     r7,             @scrcol(b       *r11 scrcol  .word 0 coltbl  .word  1CF1h(.word  161Eh(.word  141Fh(.word  0C1DEh(.word  4F4Bh(.word  0F517h( vdpstr  .word   4800h lastln  .word   4B98h zero    .word   0 (.end(