home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / 22rsx / rxmd.ark.2 / RXMD11.MAC < prev    next >
Encoding:
Text File  |  1985-12-07  |  2.0 KB  |  78 lines

  1. ;
  2. ; NOTE: 1 stop and 2 stop tables must be identical format
  3. ktable:    dw    5,  14,21,27,32,53,101,190,330,525,0;    1 stop bit
  4. ktasize    equ    $-ktable;    used to find secs divisors
  5.     db    192,69,46,36,30,18, 10,  5,  3,  2,0
  6. ktsize    equ    $-ktable;    used to find 2 stops table next
  7. ;
  8.     dw    5,  13,19,25,29,48, 92,173,300,477,0;    2 stop bits
  9.     db    192,74,51,38,33,20, 10,  6,  3,  2,0
  10. ;
  11. ; NOTE: xtable must be identical format to ktable
  12. xtable:    dw    5,  13,19,25,30,48, 85,141,210,280,0;    1 stop bit
  13.     db    192,74,51,38,32,20, 11,  8,  5,  3,0
  14. ;
  15.     dw    5,  12,18,23,27,44, 78,128,191,255,0;    2 stop bits
  16.     db    192,80,53,42,36,22, 12,  7,  5,  4,0
  17. ;
  18. ; Pass record count in RCNT: returns file's approximate
  19. ; download/upload time in minutes in BC, seconds in 'L'.
  20. ;
  21. ktim:    lxi    d,ktable
  22.     jmp    xktim
  23. ;
  24. xtim:    lxi    d,xtable;    Point to baud factor table
  25. xktim:    lhld    rcnt
  26. ;    "    "
  27. ; Time for (hl) records on table (de)^
  28. filtim:    xchg
  29.     push    d;        save rcd count
  30.     call    qstop;        modify table for stop bits
  31.     pop    d;        reorganize stack
  32.     push    h;        save table pointer
  33.     push    d;        save record count
  34.     call    mspeed;        Get speed indicator
  35.     call    indexw;        index to proper factor
  36.     mov    e,m
  37.     inx    h
  38.     mov    d,m
  39.     pop    h;        record count
  40.     call    dvhlde;        bc := (records/min) := (hl)/(de)
  41.     pop    d;        restore table pointer
  42.     push    h;        Save remainder
  43.     xchg
  44.     call    mspeed;        Get speed indicator
  45.     adi    ktasize;    offset of sec. table from main table
  46.     call    indexb;        point to divisors for secs calc
  47.     mov    a,m;        multiplier
  48.     pop    h;        Get remainder
  49.     call    mulhla;        Multiply 'H' by 'A'
  50.     call    dv16hl;        and divide by 16
  51.     mvi    h,0;        HL now = seconds (L=secs,H=0)
  52.     mov    a,l
  53.     cpi    60
  54.     jc    ftime1
  55.     sui    60
  56.     mov    l,a
  57.     inx    b;        round up minutes
  58. ftime1:
  59.     mov    a,c
  60.     ora    b
  61.     rnz;            If any minutes, exit
  62.     mov    a,l
  63.     ora    a
  64.     rnz;            If any secs, exit
  65.     inr    l;        Else show at least one sec.
  66.     ret
  67. ;
  68. ; modify table pointer hl if 1.5 or 2 stop bits
  69. ; a,f,e (hl)
  70. qstop:    mvi    a,sgbaud
  71.     mvi    e,0
  72.     call    dos;        get stop bits
  73.     ani    080h
  74.     mvi    a,ktsize
  75.     cnz    indexb;        on 1.5/2 stops select other table
  76.     ret
  77. ;
  78. Cñ