home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols100 / vol176 / usq119.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  12.9 KB  |  926 lines

  1.         org    100h
  2. true:        equ    -1
  3. false:        equ    not true
  4.  
  5.  
  6. eof:        equ    1ah
  7. dle:        equ    90h
  8. bdos:        equ    5
  9. buffer:        equ    80h
  10. fcb:        equ    50h
  11.  
  12. begin:
  13. hell:        lxi    h,0
  14.         dad    sp
  15.         shld    ccpstack
  16.         lxi    sp,stack
  17.  
  18.         lhld    bdos+1
  19.         mvi    l,0
  20.         lxi    d,-1700h
  21.         dad    d
  22.         shld    topmem
  23.         call    ilprt
  24.         db    13,10,'USQ  Version 1.19     Dave Rand     07/28/1983',0
  25.         mvi    c,25
  26.         call    bdos
  27.         sta    current
  28.         xra    a        ;default to no prompt
  29.         sta    pract
  30.         lda    buffer
  31.         ora    a
  32.         jnz    ok
  33.                     ;if no filespec, print instructions
  34.     
  35. inst:        call    ilprt
  36.         db    13,10,'Use: USQ afn [afn afn ...] [destination drive:]',0
  37.  
  38.  
  39.         mvi    a,255        ;show prompt mode active
  40.         sta    pract
  41.  
  42. in1:        call    ilprt
  43.         db    13,10,'*',0
  44.         lxi    h,buffer
  45.         mvi    m,120
  46.         xchg
  47.         mvi    c,10
  48.         call    bdos
  49.         lda    buffer+1
  50.         ora    a
  51.         jz    in1
  52.         sta    buffer
  53.         mov    e,a
  54.         mvi    d,0
  55.         lxi    h,buffer+2
  56.         push    h
  57.         dad    d
  58.         mvi    m,0
  59.         pop    h
  60.         lxi    d,buffer+1
  61. in2:        mov    a,m
  62.         stax    d
  63.         ora    a
  64.         jz    ok
  65.         call    convuc
  66.         stax    d
  67.         inx    h
  68.         inx    d
  69.         jmp    in2
  70.  
  71. convuc:        cpi    'a'
  72.         rc
  73.         cpi    'z'+1
  74.         rnc
  75.         ani    5fh
  76.         ret
  77.  
  78.  
  79.         
  80.     
  81.  
  82.  
  83. ok:
  84.         lda    pract
  85.         ora    a
  86.         jz    nosel
  87.         mvi    a,13
  88.         call    bdos
  89.         lda    current
  90.         mov    e,a
  91.         mvi    c,14
  92.         call    bdos
  93.  
  94.  
  95. nosel:        lxi    h,80h
  96.         lxi    d,locl
  97.         lxi    b,80h
  98.         call    ldir
  99.         mvi    c,25
  100.         call    bdos
  101.         sta    current
  102.         inr    a
  103.         sta    destd
  104.  
  105.         lxi    d,locl+1
  106. ex1:        call    non$blnk    ;point to first valid char
  107.         jz    inst        ;wups... no char to be had!
  108. mul1:        xchg
  109.         shld    nxtchr
  110.         lxi    h,0
  111.         shld    max1
  112.  
  113.         lxi    h,filespecs    ;point to begin of wildcard table
  114.  
  115. parse:        push    h
  116.         call    make$fcb    ;make FCB please!
  117.         lda    fcb+1
  118.         cpi    ' '
  119.         jnz    par2
  120.         call    ilprt
  121.         db    13,10,'Output drive = ',0
  122.         lda    fcb
  123.         sta    destd
  124.         adi    '@'
  125.         call    conout
  126.         call    ilprt
  127.         db    ':',0
  128.         jmp    par1
  129. par2:        pop    h
  130.         call    buildam        ;build amb file table
  131.         shld    lastmem
  132.         push    h
  133.         lhld    max1
  134.         dad    d
  135.         shld    max1
  136. par1:        lhld    nxtchr
  137. pl1:        mov    a,m
  138.         cpi    ' '
  139.         inx    h
  140.         jz    pl2
  141.         ora    a
  142.         jz    pl3
  143.         jmp    pl1
  144. pl2:        shld    nxtchr
  145.         xchg
  146.         call    non$blnk
  147. pl3:        pop    h
  148.         jnz    parse        ;all done?
  149.  
  150. gt1:
  151.                     ;Name ok, any wildcards match?
  152.         lhld    max1
  153.         mov    a,l
  154.         ora    h
  155.         jnz    cont        ;yep, can continue
  156.         call    errext
  157.         db    13,10,'No file(s) found.',0
  158.  
  159.  
  160.  
  161.  
  162. cont:
  163.         lhld    lastmem
  164.         shld    sob
  165.         shld    eob
  166.         xchg
  167.         lhld    topmem
  168.         mov    a,h
  169.         sub    d
  170.         mov    h,a
  171.         mov    a,l
  172.         sbb    e
  173.         mov    l,a
  174. ;hl now has total memory free. Divide in half.
  175.         xra    a
  176.         mov    a,h
  177.         rar
  178.         mov    h,a
  179.         mov    a,l
  180.         rar
  181.         mov    l,a
  182. ;see if enuf memory.
  183.         dcr    h
  184.         mov    a,h
  185.         ora    a
  186.         jnz    memok
  187.         call    errext
  188.         db    13,10,13,10,'Out of memory. Use more specific filenames.',0
  189.  
  190. memok:        xchg
  191.         lhld    lastmem
  192.         dad    d
  193.         shld    endmem
  194.         inr    h
  195.         inr    h
  196.         mvi    l,0
  197.         shld    sob1
  198.         shld    sob1a    
  199.         lhld    topmem
  200.         shld    eob1
  201.  
  202. main:        lxi    h,filespecs
  203.  
  204. main1:        lxi    d,ifcb
  205.         lxi    b,12
  206.         call    ldir
  207.         push    h
  208.         push    d
  209.         pop    h
  210.         inx    d
  211.         mvi    m,0
  212.         lxi    b,38-13
  213.         call    ldir
  214.         lxi    d,ifcb
  215.         mvi    c,15
  216.         call    bdos
  217.         inr    a
  218.         jz    mainr
  219. sysok:        call    ilprt
  220.         db    13,10,0
  221.         call    pfcb
  222.         lhld    lastmem
  223.         shld    sob
  224.         shld    eob
  225.         push    h
  226.         call    getw
  227.         lxi    d,0ff76h
  228.         call    cmpdehl
  229.         pop    h
  230.         jz    usq
  231.         call    ilprt
  232.         db    ' is not a squeezed file.',13,10,0
  233. mainr:        lxi    sp,stack-2
  234.         lhld    max1
  235.         dcx    h
  236.         shld    max1
  237.         mov    a,h
  238.         ora    l
  239.         pop    h
  240.         jnz    main1
  241.         jmp    usq7
  242.  
  243.  
  244. ;this is start of baseline USQ code
  245.  
  246. usq:        xra    a        ;force init char read
  247.         sta    numlft
  248.         sta    rcnt        ;and zero repeats
  249. usq1:        call    getw        ;get cksum, and store
  250.         shld    filecrc
  251.         call    ilprt
  252.         db    ' -> ',0
  253.         lxi    h,buffer    ;get name of orig. file,
  254. usq2:        push    h
  255.         call    get1        ;display, and store it
  256.         pop    h        ;for filename parse
  257.         push    psw
  258.         call    convuc
  259.         mov    b,a
  260.         pop    psw
  261.         mov    a,b
  262.         mov    m,a
  263.         jnz    mainr
  264.         ora    a
  265.         jz    usq3
  266.         push    h
  267.         call    conout
  268.         pop    h
  269.         inx    h
  270.         jmp    usq2
  271.  
  272. usq3:        lxi    h,buffer        ;parse orig. name from
  273.         shld    nxtchr            ;buffer. Create FCB
  274.         call    make$fcb
  275.         lxi    h,fcb
  276.         lxi    d,dfcb
  277.         lxi    b,1+8+3
  278.         call    ldir
  279.         lda    destd
  280.         sta    dfcb
  281.         lxi    h,dfcb+1+8+3
  282.         lxi    d,dfcb+1+8+3+1
  283.         lxi    b,38-13
  284.         mvi    m,0
  285.         call    ldir
  286.         lxi    d,dfcb
  287.         push    d
  288.         mvi    c,19
  289.         call    bdos
  290.         pop    d
  291.         mvi    c,22
  292.         call    bdos
  293.         inr    a
  294.         jnz    usq3a
  295.         call    errext
  296.         db    13,10,'No directory space. Aborting.',0
  297. usq3a:        call    getw
  298.         shld    numvals
  299.         lxi    d,258
  300.         call    cmpdehl
  301.         jc    usq3b
  302.         call    errext
  303.         db    13,10,'Files has illegal decode size. Aborting.',0
  304. usq3b:        lxi    d,table
  305. usq4:        shld    max
  306.         mov    a,h
  307.         ora    l
  308.         jz    usq5
  309.         push    d
  310.         call    getw
  311.         pop    d
  312.         xchg
  313.         mov    m,e
  314.         inx    h
  315.         mov    m,d
  316.         inx    h
  317.         push    h
  318.         call    getw
  319.         xchg
  320.         pop    h
  321.         mov    m,e
  322.         inx    h
  323.         mov    m,d
  324.         inx    h
  325.         xchg
  326.         lhld    max
  327.         dcx    h
  328.         jmp    usq4
  329.  
  330. usq5:        lxi    h,0
  331. usq6:        push    h
  332.         call    getnxt
  333.         pop    h
  334.         jnz    usq8
  335.         mov    e,a
  336.         mvi    d,0
  337.         dad    d
  338.         push    h
  339.         call    put1
  340.         pop    h
  341.         jmp    usq6
  342.  
  343. usq8:        xchg
  344.         lhld    filecrc
  345.         call    cmpdehl
  346.         push    psw
  347.         call    flush
  348.         lxi    d,dfcb
  349.         mvi    c,16
  350.         call    bdos
  351.         inr    a
  352.         jnz    usq9
  353.         call    errext
  354.         db    13,10,'Close failed...',0
  355.  
  356. usq9:        pop    psw
  357.         jz    mainr
  358.         call    ilprt
  359.         db    13,10,'ERROR - Checksum error in file ',0
  360.         call    pfcb
  361.         
  362. usq7:        lxi    sp,stack
  363.         lda    pract
  364.         ora    a
  365.         jnz    in1
  366.  
  367.         lxi    sp,0
  368. ccpstack:    equ    $-2
  369.         ret
  370.  
  371. errext:        pop    h
  372.         mov    a,m
  373.         ora    a
  374.         jz    usq7
  375.         inx    h
  376.         push    h
  377.         call    conout
  378.         jmp    errext
  379.  
  380. conout:        ani    127
  381.         mov    e,a
  382.         mvi    c,2
  383.         call    bdos
  384.         ret
  385.  
  386.  
  387. cmpdehl:    mov    a,h
  388.         cmp    d
  389.         rnz
  390.         mov    a,l
  391.         cmp    e
  392.         ret
  393.  
  394. ilprt:        pop    h
  395.         mov    a,m
  396.         ora    a
  397.         inx    h
  398.         push    h
  399.         rz
  400.         call    conout
  401.         jmp    ilprt
  402.  
  403. get1:        lhld    eob
  404.         xchg
  405.         lhld    sob
  406.         call    cmpdehl
  407.         jz    get1r
  408.         mov    a,m
  409.         inx    h
  410.         shld    sob
  411.         cmp    a
  412.         ret
  413.  
  414. get1r:        lhld    lastmem
  415.         shld    sob
  416.         shld    eob
  417. get1r1:        push    h
  418.         xchg
  419.         mvi    c,26
  420.         call    bdos
  421.         lxi    d,ifcb
  422.         mvi    c,20
  423.         call    bdos
  424.         pop    h
  425.         ora    a
  426.         jnz    get1r2
  427.         lxi    d,128
  428.         dad    d
  429.         xchg
  430.         lhld    endmem
  431.         call    cmpdehl
  432.         xchg
  433.         jnc    get1r1
  434. get1r2:        shld    eob
  435.         xchg
  436.         lhld    sob
  437.         call    cmpdehl
  438.         jnz    get1
  439.         mvi    a,255
  440.         ora    a
  441.         ret
  442.  
  443.  
  444.  
  445. put1:        mov    c,a
  446.         lhld    eob1
  447.         xchg
  448.         lhld    sob1
  449.         call    cmpdehl
  450.         jz    put1s
  451.         mov    m,c
  452.         inx    h
  453.         shld    sob1
  454.         ret
  455.  
  456. put1s:        push    b
  457.         call    flush
  458.         pop    b
  459.         mov    a,c
  460.         jmp    put1
  461.  
  462. flush:        lhld    sob1a
  463.         xchg
  464.         lhld    sob1
  465.         call    cmpdehl
  466.         rz
  467.         xchg
  468. put1sa:        push    h
  469.         xchg
  470.         mvi    c,26
  471.         call    bdos
  472.         mvi    c,21
  473.         lxi    d,dfcb
  474.         call    bdos
  475.         ora    a
  476.         jnz    put1sc
  477.         pop    h
  478.         lxi    d,128
  479.         dad    d
  480.         xchg
  481.         lhld    sob1
  482.         xchg
  483.         call    cmpdehl
  484.         jc    put1sa
  485.         lhld    sob1a
  486.         shld    sob1
  487.         ret
  488.  
  489.  
  490. put1sc:        call    errext
  491.         db    13,10,'Disk full. Aborting.',0
  492.  
  493.  
  494. getw:        call    get1
  495.         jnz    badr
  496.         push    psw
  497.         call    get1
  498.         jnz    badr
  499.         mov    h,a
  500.         pop    psw
  501.         mov    l,a
  502.         ret
  503.  
  504. badr:        call    ilprt
  505.         db    13,10,'Premature EOF on file... aborted.',0
  506.         jmp    mainr
  507.  
  508. getnxt:        lda    rcnt        ;see if in the middle of
  509.         ora    a        ;repeat sequence...
  510.         jz    getn7
  511.         dcr    a
  512.         sta    rcnt
  513.         lda    last
  514.         cmp    a
  515.         ret
  516. getn7:        call    getn4
  517.         cpi    dle
  518.         jnz    getn5
  519.         call    getn4
  520.         ora    a
  521.         jnz    getn6
  522.         mvi    a,dle        ;dle is encoded as dle,0
  523.         cmp    a
  524.         ret
  525. getn6:        dcr    a
  526.         dcr    a
  527.         sta    rcnt
  528.         lda    last
  529.         cmp    a
  530.         ret
  531. getn5:        sta    last
  532.         cmp    a
  533.         ret
  534.  
  535.  
  536. getn4:        lxi    d,0        ;pointer @ sot
  537.         lda    char
  538.         mov    c,a
  539. getn1:        lda    numlft
  540.         ora    a
  541.         jnz    getn2
  542.         push    d
  543.         call    get1
  544.         jnz    badr
  545.         pop    d
  546.         mov    c,a
  547.         mvi    a,8
  548. getn2:        dcr    a
  549.         sta    numlft
  550.         mov    a,c
  551.         rrc
  552.         mov    c,a
  553.         lxi    h,table
  554.         jnc    getn3
  555.         inx    h
  556.         inx    h        ;add 2 to point to right node
  557. getn3:        dad    d
  558.         dad    d
  559.         dad    d
  560.         dad    d        ;ok.. pointing close to right plc..
  561.         mov    e,m
  562.         inx    h
  563.         mov    d,m
  564.         mov    a,d
  565.         ani    128
  566.         jz    getn1
  567.         mov    a,c
  568.         sta    char
  569.         mov    a,d
  570.         cpi    254        ;is special eof?
  571.         mvi    a,eof
  572.         jz    geteof        ;yup
  573.         mov    a,e
  574.         cma
  575.         cmp    a
  576.         ret
  577.  
  578. geteof:        pop    h
  579.         ora    a
  580.         ret
  581.  
  582.  
  583. ;end of baseline USQ code
  584.  
  585. buildam:    equ    $
  586.         lxi    d,0        ;none found yet
  587.         push    d
  588.         push    h
  589.         lda    fcb
  590.         ora    a
  591.         jz    build1
  592.         mov    e,a
  593.         dcr    e
  594.         mvi    c,14
  595.         call    bdos
  596. build1:
  597.         mvi    c,17
  598.         lxi    d,fcb
  599.         call    bdos
  600.         pop    h
  601.         pop    d
  602.         inr    a        ;any found?
  603.         jnz    loop
  604. buildr:        push    h
  605.         push    d
  606.         lda    current
  607.         mov    e,a
  608.         mvi    c,14
  609.         call    bdos
  610.         pop    d
  611.         pop    h
  612.         ret
  613.  
  614. loop:        inx    d
  615.         push    d
  616.         push    h
  617.         dcr    a
  618.         add    a
  619.         add    a
  620.         add    a
  621.         add    a
  622.         add    a
  623.         lxi    h,buffer
  624.         mov    e,a
  625.         mvi    d,0
  626.         dad    d
  627.         pop    d
  628.         inx    h
  629.         lda    fcb
  630.         stax    d
  631.         inx    d
  632.         mvi    b,11
  633. ldir2:        mov    a,m
  634.         stax    d
  635.         inx    h
  636.         inx    d
  637.         dcr    b
  638.         jnz    ldir2
  639.         xchg
  640.         push    h
  641.         mvi    c,18
  642.         lxi    d,fcb
  643.         call    bdos
  644.         pop    h
  645.         pop    d
  646.         inr    a
  647.         jnz    loop
  648.         jmp    buildr
  649.  
  650.  
  651. pfcb:        lda    ifcb
  652.         ora    a
  653.         jz    print1
  654.         mov    b,a        ;New!
  655.         lda    current
  656.         inr    a
  657.         cmp    b
  658.         jz    print1
  659.         mov    a,b        ;New...
  660.         adi    'A'-1
  661.         call    conout
  662.         mvi    a,':'
  663.         call    conout
  664. print1:        lxi    h,ifcb+1
  665.         mvi    c,8
  666. print1a:    push    h
  667.         push    b
  668.         mov    a,m
  669.         cpi    ' '
  670.         jz    print1b
  671.         call    conout
  672. print1b:    pop    b
  673.         pop    h
  674.         inx    h
  675.         dcr    c
  676.         jnz    print1a
  677.         mvi    a,'.'
  678.         call    conout
  679.         lxi    h,ifcb+1+8
  680.         mvi    c,3
  681. print2a:    push    h
  682.         push    b
  683.         mov    a,m
  684.         cpi    ' '
  685.         jz    print2b
  686.         call    conout
  687. print2b:    pop    b
  688.         pop    h
  689.         inx    h
  690.         dcr    c
  691.         jnz    print2a
  692.         ret
  693.  
  694. MAKE$FCB:
  695. ;
  696. ;Create a FCB in FCB
  697. ;'NEXT$CHAR' is saved pointing to the next character
  698. ;following the string set up as a file NAME.TYPE.
  699. ;
  700. ;For example, the SAVE command finds the ascii string
  701. ;corresponding to the ntmber of decimal records to write
  702. ;as a file name in the first 16 bytes of the fcb, and
  703. ;the name of the file to created in the second 16 bytes
  704. ;of the fcb.
  705. ;
  706. MAKE1$FCB:
  707.     LXI    H,FCB        ;point to ccp's fcb
  708.     PUSH    H        ;save char pointer once
  709.     LHLD    NXTCHR        ;get pointer to next char in buffer
  710.     XCHG            ;put buffer pointer in <DE>
  711.     CALL    NON$BLNK    ;get next non-blank char in acc
  712.     POP    H
  713.     LDAX    D
  714.     ORA    A
  715.     JZ    NO$DRV
  716.     SBI    '@'
  717.     MOV    B,A
  718.     INX    D
  719.     LDAX    D
  720.     CPI    ':'
  721.     JZ    YES$DRV
  722.     DCX    D
  723. NO$DRV: LDA    current
  724.     inr    a        ;@1.02
  725.     MOV    M,A
  726.     JMP    GET$NAME
  727. ;
  728. YES$DRV:
  729.     MOV    M,b
  730.     INX    D
  731. ;
  732. ;The next 8 characters in the CCP$FCB are to be a file
  733. ;name.    Transfer the contents of the CON$BUF, checking
  734. ;for reserved characters and ambigious name char ('*' or '?')
  735. ;filling with blanks or '?' as required.
  736. ;
  737. GET$NAME:
  738.     MVI    B,8
  739. GET1$NAME:
  740.     CALL    TEST4RES
  741.     JZ    FIL$SPC
  742.     INX    H
  743.     CPI    '*'
  744.     JNZ    NOT$AMB
  745.     MVI    M,3FH
  746.     JMP    KEEP$CNT
  747. ;
  748. NOT$AMB:
  749.     MOV    M,A
  750.     INX    D
  751. KEEP$CNT:
  752.     DCR    B
  753.     JNZ    GET1$NAME
  754. FIND$RES:
  755.     CALL    TEST4RES
  756.     JZ    PUT$TYPE
  757.     INX    D
  758.     JMP    FIND$RES
  759. ;
  760. FIL$SPC:
  761.     INX    H
  762.     MVI    M,' '
  763.     DCR    B
  764.     JNZ    FIL$SPC
  765. ;
  766. ;The next three characters in the CCP$FCB are to be the
  767. ;file type.  Transfer the contents of CON$BUF checking
  768. ;for reserved characters and ambigious characters ('*' or '?')
  769. ;Fill with '?'s as required.
  770. ;
  771. PUT$TYPE:
  772.     MVI    B,3
  773.     CPI    '.'
  774.     JNZ    FIL2$SPC
  775.     INX    D
  776. PUT2$TYPE:
  777.     CALL    TEST4RES
  778.     JZ    FIL2$SPC
  779.     INX    H
  780.     CPI    '*'
  781.     JNZ    XFER$TYPE
  782.     MVI    M,'?'
  783.     JMP    KEEP2$CNT
  784. ;
  785. XFER$TYPE:
  786.     MOV    M,A
  787.     INX    D
  788. KEEP2$CNT:
  789.     DCR    B
  790.     JNZ    PUT2$TYPE
  791. ;
  792. ;We have a FILENAME.TYPE, so now find the next reserved
  793. ;character in the command string so we can save NEXT$CHAR
  794. ;below
  795. ;
  796. FIND1$RES:
  797.     CALL    TEST4RES
  798.     JZ    FILL$NULL
  799.     INX    D
  800.     JMP    FIND1$RES
  801. ;
  802. FIL2$SPC:
  803.     INX    H
  804.     MVI    M,' '
  805.     DCR    B
  806.     JNZ    FIL2$SPC
  807. ;
  808. ;Set the file extent (byte 12 of fcb) and the
  809. ;unused bytes (13 and 14) of the fcb to zero
  810. ;
  811. FILL$NULL:
  812.     MVI    B,3
  813. FILL1$NULL:
  814.     INX    H
  815.     MVI    M,0
  816.     DCR    B
  817.     JNZ    FILL1$NULL
  818. ;
  819. ;We are almost finished.  Save pointer of the next character
  820. ;in the console buffer, count the number of ambigious char's
  821. ;in the filename.type, and return with the count in acc and
  822. ;the flags set
  823. ;
  824.     XCHG
  825.     SHLD    NXTCHR
  826.     RET
  827.  
  828. ;
  829. ;Test char at <DE> for reserved characters 'SPACE',
  830. ;'EQUALS', 'UNDERLINE', 'PERIOD', 'COLON', 'SEMI-COLON',
  831. ;'LEFT-ARROW', 'RIGHT-ARROW', and return with zero set,
  832. ;if found.  If the character is less than an ascii SPACE,
  833. ;and exit is made to the ECHO$BUF routine which will
  834. ;print the error prompt and echo the buffer
  835. ;
  836. TEST4RES:
  837.     LDAX    D        ;get (DE) in acc
  838.     ORA    A        ;set the flags
  839.     RZ            ;get back if null
  840.     CPI    ' '        ;is it less than a SPACE?
  841.     RZ            ;if ' ', then get back
  842.     CPI    '='
  843.     RZ            ;if '=', get back
  844.     CPI    '_'
  845.     RZ            ;if '_', get back
  846.     CPI    '.'
  847.     RZ            ;if '.', get back
  848.     CPI    ':'
  849.     RZ            ;if ':', get back
  850.     CPI    ';'
  851.     RZ            ;if ';', get back
  852.     CPI    '<'
  853.     RZ            ;if '<', get back
  854.     CPI    '>'
  855.     Ret            ;if '>', get back
  856. ;
  857. ;Search the character string pointed by <DE> until
  858. ;a non-blank char or null is found.  If a null is
  859. ;found, return with ZERO flag set.  Otherwise return
  860. ;with the char in the acc and <DE> pointing to it.
  861. ;(null is placed at end of command string by convert
  862. ;routine)
  863. ;
  864. NON$BLNK:
  865.     LDAX    D        ;get next char
  866.     ORA    A        ;set flags
  867.     RZ            ;get back if null
  868.     CPI    ' '        ;is it a space?
  869.     RNZ            ;no, then get back
  870.     INX    D        ;bump the pointer
  871.     JMP    NON$BLNK    ;loop
  872.  
  873. ldir:        mov    a,m
  874.         stax    d
  875.         inx    h
  876.         inx    d
  877.         dcx    b
  878.         mov    a,b
  879.         ora    c
  880.         jnz    ldir
  881.         ret
  882.  
  883.  
  884. numvals:    dw    0
  885. max:        dw    0
  886. numlft:        db    0
  887. char:        db    0
  888. last:        db    0
  889. rcnt:        db    0
  890. lastmem:    dw    0
  891. max1:        dw    0
  892. nxtchr:        dw    0
  893. current:    db    0
  894. endmem:        dw    0
  895. topmem:        dw    0
  896. sob:        dw    0
  897. eob:        dw    0
  898. sob1:        dw    0
  899. sob1a:        dw    0
  900. eob1:        dw    0
  901. destd:        db    0
  902. pract:        db    0
  903. filecrc:    dw    0
  904.  
  905. ifcb:        ds    40
  906. dfcb:        ds    40
  907.  
  908. locl:        ds    80h
  909.  
  910.         ds    100
  911. stack:        equ    $
  912. table:        ds    258*4
  913. filespecs:    equ    $
  914.  
  915.         end    begin
  916.  
  917. 
  918. ifcb:        ds    40
  919. dfcb:        ds    40
  920.  
  921. locl:        ds    80h
  922.  
  923.         ds    100
  924. stack:        equ    $
  925. table:        ds    258*4
  926. files