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