home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / list / ep-src.ark / SENDIT.MAC < prev    next >
Encoding:
Text File  |  1988-05-21  |  14.9 KB  |  1,139 lines

  1.  
  2.  
  3. ;functions SENDIT, MRESET, HFILL, NATIVELINE
  4. ;(HFILL is internal)
  5.  
  6.     include    BDSYM.EQU
  7.     include    EPDATA
  8.  
  9.     .request GCHR
  10.  
  11.     .comment    `
  12.  
  13. int sdti;
  14. sendit()
  15. {
  16.     if (!gpoint) {skdots++; return; }
  17.  
  18.     /* position printhead        */
  19.     paperup(0);
  20.  
  21.     inover();
  22.  
  23.     if (mx || fa)
  24.     {    if (mx) {PTESCCH('L');} else {PTESCCH('Y');}
  25.         PTCH((gpoint>>1) % 256); PTCH((gpoint>>1)/256);
  26.         for (sdti = 0; sdti < gpoint; sdti++)
  27.          if (!(sdti % 2)) PTCH(gbuf[sdti] | gbuf[sdti+1]);
  28.     }
  29.     else if (val['H'-'@']['R'-'@'])
  30.     {
  31.         PTESCCH('Z'); PTCH(gpoint % 256); PTCH(gpoint/256);
  32.         for (sdti = 0; sdti < gpoint; sdti++)
  33.          if (sdti % 2) PTCH(gbuf[sdti]); else PTCH('\0');
  34.  
  35.         PTCH('\r');
  36.  
  37.         inover();
  38.  
  39.         PTESCCH('Z'); PTCH(gpoint % 256); PTCH(gpoint/256);
  40.         for (sdti = 0; sdti < gpoint; sdti++)
  41.          if (sdti % 2) PTCH('\0'); else PTCH(gbuf[sdti]);
  42.  
  43.     }
  44.     else
  45.     {
  46.         PTESCCH('Z'); PTCH(gpoint % 256); PTCH(gpoint/256);
  47.         for (sdti = 0; sdti < gpoint; sdti++) PTCH(gbuf[sdti]);
  48.     }
  49.     PTCH('\r');
  50.     skdots++;
  51. }
  52.  
  53. inover()
  54. {
  55.     /* over for indentation        */
  56.     if (nc)    hfill(lindent[ 1] + ad, FALSE);
  57.     else    hfill(lindent[cc] + ad, FALSE);
  58. }
  59.  
  60.             `
  61.  
  62. sendit::
  63.     push    b
  64.  
  65. ;    if (!gpoint) {skdots++; return; }
  66.  
  67.     lhld    gpoint
  68.     mov    a,h
  69.     ora    l
  70.     jz    .sdtx
  71.  
  72. ;
  73. ;    /* position printhead        */
  74. ;    paperup(0);
  75.     lxi    h,0
  76.     push    h
  77.     call    paperup##
  78.     pop    d
  79.  
  80. ;if noprint, can skip rest
  81.     lda    noprint
  82.     ora    a
  83.     jnz    .sdtx
  84.  
  85. ;
  86. ;    inover();
  87. ;;;    call    inover
  88.  
  89. ;
  90. ;    if (mx || fa)
  91.     lda    mx
  92.     ora    a
  93.     mvi    a,'L'
  94.     jnz    .sdt1
  95.     lda    fa
  96.     ora    a
  97.     jz    .sdt3
  98. ;    {    if (mx) {PTESCCH('L');} else {PTESCCH('Y');}
  99.     mvi    a,'Y'
  100. .sdt1:    call    presc1
  101.  
  102. ;        PTCH((gpoint>>1) % 256); PTCH((gpoint>>1)/256);
  103.  
  104. ;;;    lhld    _zlfill
  105. ;;;    lxi    d,1
  106. ;;;    call    shlrbe
  107. ;;;    push    h
  108. ;;;    push    h
  109.  
  110.     lhld    gpoint
  111. ;force to next even number
  112.     inx    h
  113. ;PLUS some
  114.     mvi    e,1
  115.     call    shlrbe
  116. ;;;    pop    d
  117. ;;;    dad    d
  118.     call    prw
  119. ;PLUS some nuls
  120. ;;;    pop    h
  121. ;;;    call    lfillz
  122.  
  123. ;        for (sdti = 0; sdti < gpoint; sdti++)
  124. ;            changed to ... sdti++,sdti++
  125.  
  126.     call    stgcnt
  127.  
  128. .sdt2:
  129. ;         if (!(sdti % 2)) PTCH(gbuf[sdti] | gbuf[sdti+1]);
  130. ;            changed no 'if'
  131.  
  132.     mov    a,m
  133.     inx    h
  134.     ora    m
  135.     inx    h
  136.     call    pr1
  137.  
  138. ;    }
  139.     dcx    b
  140.     mov    a,b
  141.     ora    c
  142.     jz    .sdt6
  143.     dcx    b
  144.     mov    a,b
  145.     ora    c
  146.     jnz    .sdt2
  147.  
  148.     jmp    .sdt6
  149.  
  150. ;    else if (val['H'-'@']['R'-'@'])
  151. ;    {
  152. .sdt3:    lda    val + 54*('H'-'@') + 2*('R'-'@')    ;5dda
  153.     ora    a
  154.     jz    .sdt4
  155. ;        PTESCCH('Z'); PTCH(gpoint % 256); PTCH(gpoint/256);
  156.  
  157.     mvi    a,'Z'
  158.     call    presc1
  159.  
  160.     call    prgpw
  161.  
  162.  
  163. ;        for (sdti = 0; sdti < gpoint; sdti++)
  164. ;         if (sdti % 2) PTCH(gbuf[sdti]); else PTCH('\0');
  165.     mvi    e,0    ;first pass out 0 if even
  166.     call    prevryother
  167.  
  168.  
  169. ;
  170. ;        PTCH('\r');
  171.     mvi    a,0dh
  172.     call    pr1
  173.  
  174. ;
  175. ;        inover();
  176. ;-    call    inover
  177. ;
  178. ;        PTESCCH('Z'); PTCH(gpoint % 256); PTCH(gpoint/256);
  179.  
  180.     mvi    a,'Z'
  181.     call    presc1
  182.  
  183.     call    prgpw
  184.  
  185. ;        for (sdti = 0; sdti < gpoint; sdti++)
  186. ;         if (sdti % 2) PTCH('\0'); else PTCH(gbuf[sdti]);
  187.     mvi    e,1    ;second pass out 0 if odd
  188.     call    prevryother
  189.  
  190.     jmp    .sdt6
  191.  
  192. ;    else
  193. ;    {
  194. ;        PTESCCH('Z'); PTCH(gpoint % 256); PTCH(gpoint/256);
  195. .sdt4:
  196.     mvi    a,'Z'
  197.     call    presc1
  198.  
  199.     call    prgpw
  200.  
  201. ;        for (sdti = 0; sdti < gpoint; sdti++) PTCH(gbuf[sdti]);
  202.  
  203.     call    stgcnt
  204. .sdt5:
  205.     mov    a,m
  206.     call    pr1
  207.  
  208.     inx    h
  209.     dcx    b
  210.     mov    a,b
  211.     ora    c
  212.     jnz    .sdt5
  213. ;    }
  214.  
  215. ;    PTCH('\r');
  216. .sdt6:
  217.     mvi    a,0dh
  218.     call    pr1
  219.  
  220. ;    skdots++;
  221. ;}
  222. .sdtx:
  223.     lhld    skdots
  224.     inx    h
  225.     shld    skdots
  226.     pop    b
  227.     ret
  228.  
  229.  
  230. prevryother:
  231. ;        for (sdti = 0; sdti < gpoint; sdti++)
  232.  
  233.     call    stgcnt
  234.  
  235. .peo1:
  236. ;         if (sdti % 2) PTCH(gbuf[sdti]); else PTCH('\0');
  237.     mov    a,e
  238.     ani    1
  239. ;if even count, out 0
  240.     jz    .peo2
  241.  
  242. ;if odd count, out real byte
  243.     mov    a,m
  244. .peo2:
  245.     call    pr1
  246.  
  247.     inr    e
  248.     inx    h
  249.     dcx    b
  250.     mov    a,b
  251.     ora    c
  252.     jnz    .peo1
  253.     ret
  254.  
  255. stgcnt:
  256.     lhld    gpoint
  257.     mov    b,h
  258.     mov    c,l
  259.     lxi    h,gbuf
  260.     ret
  261. ;
  262. ;inover()
  263. ;{
  264. ;    /* over for indentation        */
  265. ;    if (nc)    hfill(lindent[ 1] + ad, FALSE);
  266. ;    else    hfill(lindent[cc] + ad, FALSE);
  267. ;}
  268.  
  269. ;(revise so just set the value, and call hfill only for nativeline)
  270. inover::
  271.     lhld    lindent+2*1
  272.     xchg
  273.     lda    val + 54*('N'-'@') + 2*('C'-'@')
  274.     ora    a
  275.     cz    getlindent##
  276.     lhld    val + 54*('A'-'@') + 2*('D'-'@')
  277.     dad    d
  278.  
  279. ;plus left-inside or left-outside
  280.     xchg
  281.     lhld    val + 54*('L'-'@') + 2*('I'-'@')
  282.     lda    pn
  283.     ani    1
  284.     jnz    $+6
  285.     lhld    val + 54*('L'-'@') + 2*('O'-'@')
  286.     dad    d
  287.  
  288. ;check not negative
  289.     mov    a,h
  290.     ora    a
  291.     rp
  292.     lxi    h,0
  293.     ret
  294.  
  295.  
  296.     .comment    `
  297.  
  298. /************************************************/
  299. /* Tell Epson what kind of characters to print    */
  300. /************************************************/
  301. mreset(m)
  302. {    int dif;
  303.  
  304.     if (!(dif = emode ^ m)) return;
  305.  
  306.     if (dif & 61)
  307.  
  308.     if (mx)
  309.     {    dif &= 61;
  310.         if (CMPRSSD & dif)
  311.           if (CMPRSSD & m) PTCH(15); else PTCH(18);;
  312.         if (EMPHSZD & dif)
  313.           if (EMPHSZD & m) {PTESCCH('E');} else PTESCCH('F');;
  314.         if (DBLSTRK & dif)
  315.           if (DBLSTRK & m) {PTESCCH('G');} else PTESCCH('H');;
  316.         if (EXPNDD & dif)
  317.         {    PTESCCH('W');
  318.           if (EXPNDD & m) PTCH(1); else PTCH(0);
  319.         }
  320.     }
  321.  
  322.     else
  323.     {    PTESCCH('!');
  324.         PTCH(m & 61);
  325.     }
  326.  
  327.  
  328.     if (UNDRLN & dif)
  329.         { PTESCCH('-');
  330.           if (UNDRLN & m) PTCH(1); else PTCH(0);
  331.         }
  332.     if (PRPTNL & dif)
  333.         { PTESCCH('p');
  334.           if (PRPTNL & m) PTCH(1); else PTCH(0);
  335.         }
  336.     if (SUPSCRPT & dif)
  337.         { if (SUPSCRPT & m) {PTESCCH('S'); PTCH(1);}
  338.           else {PTESCCH('T');}
  339.         }
  340.     if (SUBSCRPT & dif)
  341.         { if (SUBSCRPT & m) {PTESCCH('S'); PTCH(0);}
  342.           else {PTESCCH('T');}
  343.         }
  344.  
  345.     emode = m;
  346. }
  347.  
  348.             `
  349.  
  350. mreset::
  351.  
  352.  
  353. ;get list vector
  354.     lhld    1
  355.     lxi    d,4*3
  356.     dad    d
  357.     shld    _biopr+1
  358.  
  359.     pop    d
  360.     pop    h
  361.     push    h
  362.     push    d
  363.  
  364.     push    b
  365. ;arg m kept in HL
  366. ;local dif kept in BC
  367.  
  368. ;    if (!(dif = emode ^ m)) return;
  369.  
  370.     xchg
  371.     lhld    emode
  372.     xchg
  373.  
  374.     mov    a,h
  375.     xra    d
  376.     ani    0f8h
  377.     mov    b,a
  378.     mov    a,l
  379.     xra    e
  380.     ani    not ITALIC
  381.     mov    c,a
  382.     ora    b
  383.     jz    .mrx
  384. ;
  385. ;    if (dif & 61)
  386.  
  387.     mov    a,c
  388.     ani    61
  389.     jz    .mr9
  390. ;
  391. ;    if (mx)
  392.     lda    mx
  393.     ora    a
  394.     jz    .mr8
  395.  
  396. ;    {    dif &= 61;
  397. ;why did I do this? -- doesn't seem right
  398. ;    mov    a,c
  399. ;    ani    61
  400. ;    mov    c,a
  401.  
  402. ;        if (CMPRSSD & dif)
  403.  
  404.     mvi    a,CMPRSSD
  405.     call    .mrTEST
  406.     jnc    .mr2
  407.  
  408.  
  409. ;          if (CMPRSSD & m) PTCH(15); else PTCH(18);;
  410.  
  411.     mvi    a,15
  412.     jnz    .mr1
  413.     mvi    a,18
  414.  
  415. .mr1:
  416.     call    pr1
  417.  
  418. ;        if (EMPHSZD & dif)
  419. .mr2:
  420.     mvi    a,EMPHSZD
  421.     call    .mrTEST
  422.     jnc    .mr4
  423. ;          if (EMPHSZD & m) {PTESCCH('E');} else PTESCCH('F');;
  424.     mvi    a,'E'
  425.     jnz    .mr3
  426.     mvi    a,'F'
  427. .mr3:    call    presc1
  428.  
  429. .mr4:
  430. ;        if (DBLSTRK & dif)
  431.     mvi    a,DBLSTRK
  432.     call    .mrTEST
  433.     jnc    .mr6
  434. ;          if (DBLSTRK & m) {PTESCCH('G');} else PTESCCH('H');;
  435.     mvi    a,'G'
  436.     jnz    .mr5
  437.     mvi    a,'H'
  438. .mr5:    call    presc1
  439.  
  440. .mr6:
  441. ;        if (EXPNDD & dif)
  442.     mvi    a,EXPNDD
  443.     call    .mrTEST
  444. ;        {    PTESCCH('W');
  445.     mvi    e,'W'
  446.     cc    .mrTURN
  447.  
  448. ;          if (EXPNDD & m) PTCH(1); else PTCH(0);
  449. ;        }
  450. ;    }
  451.     jmp    .mr9
  452. ;
  453. ;    else
  454. ;    {    PTESCCH('!');
  455. .mr8:
  456.  
  457.     mvi    a,'!'
  458.     call    presc1
  459.  
  460. ;        PTCH(m & 61);
  461.     mov    a,l
  462.     ani    61
  463.     call    pr1
  464.  
  465. ;    }
  466.  
  467. ;
  468. ;
  469. ;    if (UNDRLN & dif)
  470. .mr9:
  471.     mvi    a,UNDRLN
  472.     call    .mrTEST
  473. ;        { PTESCCH('-');
  474.      mvi    e,'-'
  475.     cc    .mrTURN
  476.  
  477. ;          if (UNDRLN & m) PTCH(1); else PTCH(0);
  478. ;        }
  479.  
  480. ;    if (PRPTNL & dif)
  481. ;.mr11:
  482.     mvi    a,PRPTNL
  483.     call    .mrTEST
  484. ;        { PTESCCH('p');
  485.     mvi    e,'p'
  486.     cc    .mrTURN
  487. ;          if (PRPTNL & m) PTCH(1); else PTCH(0);
  488. ;        }
  489.  
  490. ;    if (SUPSCRPT & dif)
  491. ;.mr13:
  492.     mov    a,b
  493. ;--    ani    supscrpt shr 8
  494.     ani    suBscrpt shr 8
  495.     jz    .mr15
  496. ;        { if (SUPSCRPT & m) {PTESCCH('S'); PTCH(1);}
  497.     mov    a,h
  498. ;----    ani    supscrpt shr 8
  499.     ani    suBscrpt shr 8
  500.     jz    .mr14
  501.     mvi    a,'S'
  502.     call    presc1
  503.     mvi    a,1
  504.     call    pr1
  505.     jmp    .mr15
  506. ;          else {PTESCCH('T');}
  507. ;        }
  508. .mr14:    mvi    a,'T'
  509.     call    presc1
  510.  
  511. ;    if (SUBSCRPT & dif)
  512. .mr15:    mov    a,b
  513. ;----    ani    subscrpt shr 8
  514.     ani    suPscrpt shr 8
  515.     jz    .mr17
  516. ;        { if (SUBSCRPT & m) {PTESCCH('S'); PTCH(0);}
  517.     mov    a,h
  518. ;---    ani    subscrpt shr 8
  519.     ani    suPscrpt shr 8
  520.     jz    .mr16
  521.  
  522.     mvi    a,'S'
  523.     call    presc1
  524.     xra    a
  525.     call    pr1
  526.  
  527.     jmp    .mr17
  528. ;          else {PTESCCH('T');}
  529. ;        }
  530. .mr16:    mvi    a,'T'
  531.     call    presc1
  532.  
  533. ;
  534. ;    emode = m;
  535. ;}
  536. .mr17:
  537.     shld    emode
  538.  
  539. .mrx:
  540.     pop    b
  541.     ret
  542.  
  543. .mrTURN:
  544.     mov    d,a
  545.     mov    a,e
  546.     call    presc1
  547.     mov    a,d
  548.     jmp    pr1
  549.  
  550. .mrTEST:
  551.     mov    e,a
  552.     ana    c
  553.     rz
  554.     mov    a,e
  555.     ana    l
  556.     mvi    a,0
  557.     cmc
  558.     rz
  559.     mvi    a,1
  560.     ret
  561.  
  562.     .comment    `
  563.  
  564. /************************************************/
  565. /* Move print head to right by 'n' dots,    */
  566. /*    underlining if 'fch' is true        */
  567. /************************************************/
  568. hfill(n, fch)
  569. int n;
  570. char fch;
  571. {    int i, lensp;
  572.  
  573.     if (!n) return;
  574.  
  575.     if (!(lensp = modelen[emode & 63]))
  576.     {    lensp = pmlen[' '];
  577.         if (emode & EXPNDD) lensp <<= 1;
  578.     }
  579.  
  580.     while (n >= lensp) {PTCH(' ');    n -= lensp;}
  581.  
  582.     if (mx)
  583.     {    n >>= 1;
  584.         if (n)
  585.         {    PTESCCH('L');
  586.             PTCH(n); PTCH(0);
  587.             while (n--) PTCH(0);
  588.         }
  589.     }
  590.  
  591.     else
  592.         if (n)
  593.         /* fch is TRUE for underscoring Epson font */
  594.         {    if (fch) {PTESCCH('J'); PTCH(3);}
  595.             PTESCCH('Z');
  596.             PTCH(n); PTCH(0);
  597.             while (n--) PTCH(fch & 1);
  598.             if (fch) {PTESCCH('j'); PTCH(3);}
  599.         }
  600. }
  601.  
  602.             `
  603.  
  604. ;made internal -- fch in A, n in HL
  605. hfill:
  606.     sta    fch
  607.  
  608.     mov    a,h
  609.     ora    l
  610.     rz
  611.  
  612.     push    b
  613.  
  614.     mov    b,h
  615.     mov    c,l
  616. ;BC = n
  617.  
  618.  
  619. ;    if (!n) return;
  620. ;(cf. above)
  621. ;
  622. ;    if (!(lensp = modelen[emode & 63]))
  623.  
  624.     lda    emode
  625.     ani    63
  626.     mov    e,a
  627.     mvi    d,0
  628.     lxi    h,modelen
  629.     dad    d
  630.     mov    l,m
  631.     mvi    h,0
  632.     shld    lensp
  633.     mov    a,l
  634.     ora    a
  635.     jnz    .hf1
  636.  
  637. ;    {    lensp = pmlen[' '];
  638.  
  639.     lda    pmlen + ' '    ;64f1
  640.     sta    lensp
  641.  
  642. ;        if (emode & EXPNDD) lensp <<= 1;
  643. ;    }
  644.     mov    l,a
  645.     mvi    h,0
  646. ;    lhld    lensp
  647.     lda    emode
  648.     ani    EXPNDD
  649.     jz    .hf1
  650.  
  651.     dad    h
  652.     shld    lensp
  653.  
  654. ;
  655. ;    while (n >= lensp) {PTCH(' ');    n -= lensp;}
  656. .hf1:
  657. ;DE = -lensp (throughout following loop)
  658.     call    cmh
  659.     xchg
  660.  
  661. .hf2:
  662. ;HL = -lensp
  663.     mov    h,d
  664.     mov    l,e
  665. ;HL = n - lensp
  666.     dad    b
  667. ;done if HL < 0
  668.     mov    a,h
  669.     ora    a
  670.     jm    .hf3
  671.  
  672. ;else n = HL = n - lensp
  673.     mov    b,h
  674.     mov    c,l
  675.  
  676. ;out SP
  677.     mvi    a,' '
  678.     call    pr1
  679.  
  680.     push    d
  681.     mvi    a,' '
  682.     call    termput##
  683.     pop    d
  684.  
  685. ;loop
  686.     jmp    .hf2
  687.  
  688. ;
  689. ;    if (mx)
  690. .hf3:    lda    mx
  691.     ora    a
  692.     jz    .hf6
  693.  
  694. ;    {    n >>= 1;
  695.  
  696. ;(carry is clear)
  697.     mov    a,b
  698.     rar
  699.     mov    b,a
  700.     mov    a,c
  701.     rar
  702.     mov    c,a
  703.  
  704. ;        if (n)
  705.  
  706.     mov    a,c
  707.     ora    a
  708.     jz    .hf5
  709.  
  710. ;        {    PTESCCH('L');
  711.     
  712.     mvi    a,'L'
  713.     call    presc1
  714.  
  715. ;            PTCH(n); PTCH(0);
  716.  
  717.     mov    a,c
  718.     call    pr1
  719.     xra    a
  720.     call    pr1
  721.  
  722. ;            while (n--) PTCH(0);
  723. ;        }
  724. ;    }
  725. .hf4:
  726.     xra    a
  727.     call    pr1
  728.     dcr    c
  729.     jnz    .hf4
  730.  
  731. .hf5:
  732.     pop    b
  733.     ret
  734. ;
  735. ;    else
  736. ;        if (n)
  737. .hf6:
  738.     mov    a,b
  739.     ora    c
  740.     jz    .hfx
  741. ;        /* fch is TRUE for underscoring Epson font */
  742. ;        {    if (fch) {PTESCCH('J'); PTCH(3);}
  743.  
  744.     lda    fch
  745.     ani    1    ;E = fch & 1 for later
  746.     mov    e,a
  747.     ora    a
  748.     jz    .hf7
  749.  
  750.     mvi    a,'J'
  751.     call    presc1
  752.     mvi    a,3
  753.     call    pr1
  754.  
  755. ;            PTESCCH('Z');
  756. .hf7:
  757.     mvi    a,'Z'
  758.     call    presc1
  759.  
  760. ;            PTCH(n); PTCH(0);
  761.     mov    a,c
  762.     call    pr1
  763.     xra    a
  764.     call    pr1
  765.  
  766. ;            while (n--) PTCH(fch & 1);
  767. .hf8:
  768.  
  769.     mov    a,e
  770.     call    pr1
  771.  
  772.     dcr    c
  773.     jnz    .hf8
  774.  
  775. ;            if (fch) {PTESCCH('j'); PTCH(3);}
  776.  
  777.     mov    a,e
  778.     ora    a
  779.     jz    .hfx
  780.  
  781.     mvi    a,'j'
  782.     call    presc1
  783.     mvi    a,3
  784.     call    pr1
  785.  
  786. ;        }
  787. ;}
  788. .hfx:
  789.     pop    b
  790.     ret
  791.  
  792. fch:    dw    0
  793. lensp:    dw    0
  794.  
  795.  
  796.  
  797.     .comment    `
  798.  
  799. /************************************************/
  800. /* Do a line of Epson native characters        */
  801. /************************************************/
  802. nativeline()
  803. {    int cumfill;
  804.     char c;
  805.  
  806.     if (!epsflag) {skdots++; return; }
  807.  
  808.     cumfill = 0;
  809.  
  810.     /* don't underline to left of margin        */
  811.     mreset(emode & ~UNDRLN);
  812.     paperup(0);
  813.     inover();
  814. /*    hfill(lindent[cc]+ad, FALSE);        */
  815.  
  816.     for (gsti = 0; gsti < outpoint; gsti++)
  817.     {    /* if graphics font, just fill        */
  818.         if (attrbuf[gsti] & 0x700)
  819.             cumfill += widbuf[gsti];
  820.  
  821.         /* Is it a variable space?        */
  822.         else if ((c = outbuf[gsti]) == ' ')
  823.         { if (attrbuf[gsti] & UNDRLN)
  824.           {    hfill(cumfill, FALSE);
  825.             hfill(widbuf[gsti], TRUE);
  826.             cumfill = 0;
  827.           }
  828.           else cumfill += widbuf[gsti];
  829.         }
  830.  
  831.         else if (c == SOFTHY || c >= 0x7F) continue;
  832.  
  833.         else /* real Epson character        */
  834.         {    hfill(cumfill, FALSE);
  835.             mreset(attrbuf[gsti]);
  836.             cumfill = 0;
  837.             if (c == rb) c = ' ';
  838.             if (!widbuf[gsti]) PTCH('\b');
  839.             PTCH( (attrbuf[gsti] & ITALIC) | c);
  840.         }
  841.     }
  842.     PTCH('\r');
  843.     skdots++;
  844. }
  845.  
  846.             `
  847.  
  848.  
  849. nativeline::
  850.     push    b
  851.  
  852.  
  853. ;    if (!epsflag) {skdots++; return; }
  854.  
  855.  
  856.     lda    epsflag
  857.     ora    a
  858.     jz    .ntskX
  859. ;
  860. ;    cumfill = 0;
  861. i1a70:    lxi    h,0
  862.     shld    cumfill
  863.  
  864. ;
  865. ;    /* don't underline to left of margin        */
  866. ;    mreset(emode & ~UNDRLN);
  867.     lhld    emode
  868.     lxi    d,not UNDRLN    ;ffbf
  869.     mov    a,h
  870.     ana    d
  871.     mov    h,a
  872.     mov    a,l
  873.     ana    e
  874.     mov    l,a
  875.     push    h
  876.     call    mreset
  877.     pop    d
  878.  
  879. ;    paperup(0);
  880.     lxi    h,0
  881.     push    h
  882.     call    paperup##
  883.     pop    d
  884.  
  885. ;    inover();
  886.  
  887.     call    inover
  888.     xra    a
  889.     call    hfill
  890. ;
  891. ;    for (gsti = 0; gsti < outpoint; gsti++)
  892.     lxi    b,0
  893. .ntLOOP:
  894.     mov    d,b
  895.     mov    e,c
  896.     lhld    outpoint
  897.     call    albs
  898.     jnc    i1c45
  899.  
  900. ;    {    /* if graphics font, just fill        */
  901. ;        if (attrbuf[gsti] & 0x700)
  902.     lhld    attrbuf
  903.     dad    b
  904.     dad    b
  905.  
  906.     inx    h
  907.     mov    a,m
  908.     ani    7
  909.     jz    i1aea
  910. ;            cumfill += widbuf[gsti];
  911.  
  912.     lhld    widbuf
  913.     dad    b
  914.     dad    b
  915.  
  916.     mov    e,m
  917.     inx    h
  918.     mov    d,m
  919.  
  920.     lhld    cumfill
  921.     dad    d
  922.     shld    cumfill
  923.  
  924.     jmp    .ntNXT
  925. ;
  926. ;        /* Is it a variable space?        */
  927. ;        else if ((c = outbuf[gsti]) == ' ')
  928. i1aea:    lhld    outbuf
  929.     dad    b
  930.  
  931.     mov    a,m
  932.     sta    _ntc
  933.  
  934.     cpi    HSFLAG
  935.     jz    .nt2
  936.  
  937.     cpi    SPFLAG
  938.     jz    .nt2
  939.  
  940.     cpi    ' '
  941.     jnz    .nt5
  942. .nt2:
  943.  
  944. ;        { if (attrbuf[gsti] & UNDRLN)
  945.     lhld    attrbuf
  946.     dad    b
  947.     dad    b
  948.  
  949.     mov    a,m
  950.     ani    undrln
  951. ;    jz    .nt3
  952.     jnz    .nt2a
  953. ;reset the mode, in case we have a non-underlined space, following
  954. ; an underlined real character
  955.     mov    e,a
  956.     inx    h
  957.     mov    d,m
  958.     push    d
  959.     call    mreset
  960.     pop    d
  961.     jmp    .nt3
  962. ;          {    hfill(cumfill, FALSE);
  963. .nt2a:    xra    a
  964.     lhld    cumfill
  965.     call    hfill
  966.  
  967. ;            hfill(widbuf[gsti], TRUE);
  968.  
  969.     lhld    widbuf
  970.     dad    b
  971.     dad    b
  972.     mov    e,m
  973.     inx    h
  974.     mov    d,m
  975.     xchg
  976.  
  977.     mvi    a,1
  978.     call    hfill
  979.  
  980. ;            cumfill = 0;
  981. ;          }
  982.     lxi    h,0
  983.     shld    cumfill
  984.     jmp    .ntNXT
  985.  
  986. ;          else cumfill += widbuf[gsti];
  987. ;        }
  988. .nt3:
  989.  
  990.     lhld    widbuf
  991.     dad    b
  992.     dad    b
  993.  
  994.     mov    e,m
  995.     inx    h
  996.     mov    d,m
  997.  
  998.     lhld    cumfill
  999.     dad    d
  1000.     shld    cumfill
  1001. .nt4:    jmp    .ntNXT
  1002. ;
  1003. ;        else if (c == SOFTHY || c >= 0x7F) continue;
  1004. .nt5:    lda    _ntc
  1005.     cpi    SOFTHY
  1006.     jz    .ntNXT
  1007.  
  1008.     cpi    7fh
  1009.     jnc    .ntNXT
  1010. ;
  1011. ;        else /* real Epson character        */
  1012. ;        {    hfill(cumfill, FALSE);
  1013. .nt6:
  1014.     xra    a
  1015.     lhld    cumfill
  1016.     call    hfill
  1017. ;            mreset(attrbuf[gsti]);
  1018.     lhld    attrbuf
  1019.     dad    b
  1020.     dad    b
  1021.  
  1022.     mov    e,m
  1023.     inx    h
  1024.     mov    d,m
  1025.     push    d
  1026.     call    mreset
  1027.     pop    d
  1028. ;            cumfill = 0;
  1029.  
  1030.     lxi    h,0
  1031.     shld    cumfill
  1032. ;            if (c == rb) c = ' ';
  1033.     lxi    h,_ntc
  1034.     lda    rb
  1035.     cmp    m
  1036.     jnz    .nt7
  1037.     mvi    m,' '
  1038. ;            if (!widbuf[gsti]) PTCH('\b');
  1039. .nt7:    lhld    widbuf
  1040.     dad    b
  1041.     dad    b
  1042.  
  1043.     mov    a,m
  1044.     inx    h
  1045.     ora    m
  1046.  
  1047.     mvi    a,8
  1048.     cz    pr1
  1049.  
  1050. ;            PTCH( (attrbuf[gsti] & ITALIC) | c);
  1051. ;        }
  1052. ;    }
  1053. .nt8:    lhld    attrbuf
  1054.     dad    b
  1055.     dad    b
  1056.  
  1057.     mov    a,m
  1058.     ani    italic
  1059.     lxi    h,_ntc
  1060.     ora    m
  1061.  
  1062.     call    pr1
  1063.  
  1064.     lda    _ntc
  1065.     call    termput##
  1066.  
  1067. .ntNXT:    inx    b
  1068.     jmp    .ntLOOP
  1069.  
  1070. ;    PTCH('\r');
  1071. i1c45:    mvi    a,0dh
  1072.     call    pr1
  1073.  
  1074. ;    skdots++;
  1075. .ntskX:
  1076.     lhld    skdots
  1077.     inx    h
  1078.     shld    skdots
  1079. ;}
  1080. .ntX:
  1081.     pop    b
  1082.     ret
  1083.  
  1084. cumfill:    dw    0
  1085. _ntc:        db    0
  1086.  
  1087.  
  1088.  
  1089.     .comment    *
  1090. List output        *
  1091.  
  1092. prgpw:    lhld    gpoint
  1093. ;PLUS some for indent
  1094. ;;;    xchg
  1095. ;;;    lhld    _zlfill
  1096. ;;;    push    h
  1097. ;;;    dad    d
  1098. ;;;    call    prw
  1099. ; THEN print the word
  1100. ; Then print the extra nuls
  1101. ;;;    pop    h
  1102. ;;;lfillz:
  1103. ;;;    mov    a,h
  1104. ;;;    ora    l
  1105. ;;;    rz
  1106. ;;;    xra    a
  1107. ;;;    call    pr1
  1108. ;;;    dcx    h
  1109. ;;;    jmp    lfillz
  1110.  
  1111. ;;;_zlfill:    dw    0    
  1112.  
  1113.  
  1114.  
  1115. prw:    mov    a,l
  1116.     call    pr1
  1117.     mov    a,h
  1118.     jmp    pr1
  1119.  
  1120. presc1::
  1121.     push    psw
  1122.     mvi    a,1bh
  1123.     call    pr1
  1124.     pop    psw
  1125. pr1::    push    b
  1126.     push    h
  1127.     push    d
  1128.     mov    c,a
  1129.     lda    noprint
  1130.     ora    a
  1131. _biopr:
  1132.     cz    0    ;filled in by mreset
  1133.     pop    d
  1134.     pop    h
  1135.     pop    b
  1136.     ret
  1137.  
  1138.     end
  1139.