home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG052.ARK / CPYFST35.DOC < prev    next >
Text File  |  1984-04-29  |  28KB  |  616 lines

  1.  
  2.               COPYFAST.ASM Version 3.5
  3.  
  4.                               for
  5.  
  6.             IBM 3741 Compatible Diskettes
  7.  
  8.         (Originally written by: Chuck Weingart    )
  9.         (        2152 W. Iowa        )
  10.         (        Chicago, Ill 60622    )
  11.  
  12. ------------------------------------------------------------
  13.  
  14. This program is placed in the public domain. Selling or
  15. licensing of this program is prohibited. (You are encour-
  16. aged to give it away to all of your friends). If you make
  17. changes that may benefit others, please send the new
  18. version to the CPM Users Group, so all may have it.
  19.  
  20. ------------------------------------------------------------
  21.  
  22.  
  23. Modified:
  24.     Version 1.0; by Chuck Weingart
  25.         October 1980: after the public domain
  26.         Tarbell disk copy program (does not
  27.         require a Tarbell controller)
  28.     Version 1.1; by Kelly Smith
  29.         January 21, 1981:
  30.         ( >>>modifications undocumented <<< )
  31.     Version 1.2; C. Strom
  32.         February 12, 1981: corrected typo
  33.         in OBJMSG when SINGLE true; added
  34.         a CR.
  35.     Version 2.0; by Chuck Weingart
  36.         February 16, 1981: Changed messages added
  37.         in V1.1 and 1.2 back to upper case - some
  38.         people have terminals that dont handle
  39.         lower case.
  40.     Version 2.1; C.W.
  41.         February 18, 1981: added code to check
  42.         console port for Ctrl-C abort condition
  43.         during copy, and misc code to help in
  44.         CP/M 2.2 systems that block and deblock
  45.         from large sectors.
  46.     Version 2.2; C.W.
  47.         February 24, 1981: added auto size check.
  48.         Added interleave table suitable for very
  49.         fast disk controllers.
  50.     Version 2.3; C.W.
  51.         March 2, 1981: Change all references to
  52.         EXITCP to EXIT so that user gets a chance
  53.         to put in system disk before program re-
  54.         boots CP/M.
  55.     VERSION 3.0; C.W.
  56.         March 6, 1981: Check if given number of
  57.         buffers will overlay the BIOS and reduce
  58.         accordingly.
  59.         Moved comments to DOC file to keep the
  60.         source editable in one pass, and add
  61.         more explanation to the comments on
  62.         sector sizes and read skewing.
  63.     Version 3.1; C.W.
  64.         March 10, 1981: Added TSKEW and code for
  65.         track skewing to increase speed for fast
  66.         controllers.
  67.         Separated read and write error checking:
  68.         NUMERR now applies to each track read,
  69.         but to each entire write pass.
  70.     Version 3.2; C.W.
  71.         March 18, 1981: Corrected read skew bug
  72.         noticed by Steve Bogolub. Added CR,LF to
  73.         the read and write error messages that
  74.         got deleted in version 1.1
  75.         Added WRSWCH, WRCODE, WRTAB to help solve
  76.         problems with CP/M 2.2 blocking with some
  77.         manufacturers CBIOS routines.
  78.     Version 3.3; C.W.
  79.         March 22, 1981: Added DIFFTRK (ability to
  80.         copy from different tracks) in order to be
  81.         able to unpack UCSD Pascal disks.
  82.     Version 3.4; C.W.
  83.         May 9, 1981: Fix bug in read error recovery
  84.         that caused bad read to repeat forever.
  85.         (Took me two attempts. No branch to TRYRDA.)
  86.         Changed NUMERR to 4.
  87.     Version 3.5; C.W.
  88.         May 16, 1981: Add parameter for specifying
  89.         the range of tracks copied. Removed CRLF
  90.         between source and object messages. Moved
  91.         INIT message to one-time code. Display #
  92.         of buffers used if insufficient space. Echo
  93.         source and object drives. Home drives after
  94.         the copy is complete (to flush buffers).
  95.  
  96.  
  97. Note to subsequent modifiers:
  98.     Please note the specific changes you make to the
  99.     code, so that others can keep track what you have
  100.     done, even if it is just lower case messages.
  101.  
  102. ------------------------------------------------------------
  103.  
  104.  This  program  will  copy the data area of one CP/M disk to
  105. another (thats tracks 2 - 76), as  fast  as  possible.   All
  106. data  written  is  read  back  to  verify that the write was
  107. successful, and multiple tracks are copied in one pass,  for
  108. speed.   The version as supplied assumes that the controller
  109. CRC checking is sufficient for verification, but an assembly
  110. option allows complete byte-by-byte comparison on  the  read
  111. back.  It is possible to copy only part of a disk,  moving a
  112. block of tracks from one disk to a different part of another.
  113.  
  114.  The  program  as  supplied will automatically determine the
  115. size of the CP/M system and adjust  the  number  of  buffers
  116. accordingly.  For example, it can copy four tracks at a pass
  117. in a minimum (16K) system, and 18 tracks at a pass in a max-
  118. imum system (64K).  A fixed-buffer option is also available:
  119. the number of track buffers, and hence the minimum size, can
  120. be  changed  to  suit your system.  Only standard CP/M CBIOS
  121. calls are used to access the disk, no  BDOS  calls,  so  the
  122. BDOS and CCP can be overlaid by the track buffers.  No other
  123. CP/M  functions are assumed.  North Star CP/M or UCSD Pascal
  124. users should be able to modify this program easily to run on
  125. their systems.
  126.  
  127.  COPYFAST will allow a disk to  be  copied  on  a  one-drive
  128. system,  as  an  assembly option.  A version with 18 buffers
  129. (64K) will require only 5 complete swaps.
  130.  
  131. ------------------------------------------------------------
  132.  
  133.  Three assembled versions of the program are  supplied,  for
  134. your  convenience.   They  are  called CPYFST3F.COM for very
  135. fast disk controllers (such as CCS 2422),  CPYFST3M.COM  for
  136. controllers  (such as Micromation) that cannot write a track
  137. in one revolution, and CPYFST3S.COM for controllers (such as
  138. Versafloppy) that must interleave both reads and writes.   I
  139. recommend that you try each of the three programs to see how
  140. fast  they  run on your system.  The only difference between
  141. them is the read and write interleave.  All  three  versions
  142. do read-after-write checking and automatically determine the
  143. number  of  buffers  to  use  in the copy.  If all three COM
  144. files run very slowly you may have a slow controller  or  an
  145. inefficient  CBIOS, and it will be necessary to examine this
  146. documentation closely  and  edit  the  source  to  fit  your
  147. requirements.  The source is supplied for CPYFST3F.COM and I
  148. list  all  the differences for CPYFST3M.COM and CPYFST3S.COM
  149. later in this file.  
  150.  
  151. ------------------------------------------------------------
  152.  
  153.  To run, just type: CPYFST3n<cr>.   The  program  will  then
  154. request the source and destination disks, (drives A - F) and
  155. give  you a chance to put in the correct disks in the drives
  156. before continuing (or quit by entering CTRL-C).  When  done,
  157. the  program  will  ask  if  another  pair of disks is to be
  158. copied, and the process repeated.
  159.  
  160.  The  range  of  tracks  copied  can  also be specified in a
  161. single character parameter after the program name.  That is:
  162. CPYFST3n X<cr> where X is one of the following values:
  163.  
  164. A    All    0-76        Entire disk
  165. D    Data    2-76        CP/M data area
  166. F    First    2        CP/M directory track 
  167. L    Last    76        Last track on disk
  168. O    One    1        Track one, UCSD directory
  169. P    Pascal    1-76        UCSD Pascal data area
  170. S    System    0-1        CP/M bootstrap
  171. Z    Zero    0        Track zero, UCSD bootstrap
  172.         (Note: only complete tracks are copied)
  173.  
  174.  Only  the  first character is checked, so the full word may
  175. be spelled out, if desired.  Invalid letters will  cause  an
  176. error  message,  and  the program will not run.  The default
  177. range, currently 2  to  76,  is  given  in  the  program  at
  178. locations 12DH and 12EH.
  179.  
  180.  The console is checked often to see if the operator has en-
  181. tered a CTRL-C, so it is possible to abort the program  even
  182. during the actual copy.
  183.  
  184.  If the number of buffers specified during the assembly is
  185. too large, that is, if the CBIOS would be overlaid during
  186. the copy, then a message will be issued and the program will
  187. reduce the number of buffers to fit the system.
  188.  
  189. ------------------------------------------------------------
  190.  
  191.  This source can be assembled with the CP/M ASM or MAC.
  192.  
  193.  COPYFAST  runs  on an 8080 or similar CPU, CP/M 1.3, 1.4 or
  194. 2.2,  or Cromemco CDOS disk operating systems  as  supplied,
  195. and  does  not use any particular type of controller or disk
  196. hardware, other than the "standard" 77 track, 26 sector-per-
  197. track disk.  The latter two numbers can be easily changed in
  198. the source.
  199.  
  200.  The program currently assumes that the disk controller  can
  201. read  and write the disk in just one revolution.  This means
  202. that an entire track can  be  written  and  checked  in  two
  203. revolutions.   Two  alternate interleave tables are included
  204. in the source if this is not possible  with  your  hardware,
  205. and any sector interleave can be used by changing the table.
  206. An  assembly option is available to allow interleaved reads,
  207. if your disk controller cannot keep up with the program. An-
  208. other option is available if read interleaving is not used,
  209. to increase the read speed by changing the first sector read
  210. on each track so the read will start as soon as possible af-
  211. ter the seek is complete.
  212.  
  213.  This program  has  been  run  unaltered  on  a  Micromation
  214. Doubler  disk  controller  with Shugart drives, the Califor-
  215. nia Computer Systems model 2422A disk controller, a  Tarbell
  216. single  density  controller board, and a Cromemco 4FDC board
  217. (the latter two use a WD 1771 chip) with Persci drives,  and
  218. the worst copy time was 122 seconds.  A typical time is more
  219. like  56  seconds  (CCS  controller).  Faster hardware means
  220. faster copies.
  221.  
  222.  The program is written with all necessary constants in  eq-
  223. ates,  so  modifying  it for some other type of sector size,
  224. for example, should be fairly easy.  In fact, Roy  Lipscomb,
  225. a  member  of  the  Chicago Area Computer Hobbyist Exchange,
  226. wrote a program called FOTOCOPY  for  the  Thinkertoys  DJ2D
  227. controller after asking me a few questions about the purpose
  228. of  the  BIOS calls.  I believe he simply modified the CBIOS
  229. jump table in the program to point to the on-board EPROM  of
  230. the  DJ2D,  and  changed  the  various  equates  to what was
  231. necessary for a 512 byte double-density  disk.   He  reports
  232. really  fantastic  copy  speeds for that controller using my
  233. methods.
  234.  
  235.  The only bad comments I have heard to date is that the pro-
  236. gram  isnt  fast with the Txxxxxl and Txxxxxxxxy versions of
  237. CP/M.  The two cases I got personally involved  with  turned
  238. out  to  be  very much the same thing: poorly written sector
  239. blocking/deblocking routines.  In one case, I suggested that
  240. the interleave table be  changed  to  1,2,3,4,9,10,11,12,...
  241. in  a  512  byte  (128*4)  sector.  That way, the first four
  242. "sectors" fit into the first physical sector, and  then  the
  243. four "sectors" in the third physical sector are done, and so
  244. on.   The  second case turned out to be a bug in the DEBLOCK
  245. code that Digital Research is suggesting  be  used  in  CP/M
  246. 2.x.   The  source  they  are  distributing will miss blocks
  247. and/or cause unnecessary I/O to the disk.  If you use  their
  248. code, do so with care.
  249.  
  250.  One manufacturer of controller boards  is  supposed  to  be
  251. supplying  a  CBIOS  that  checks the density of the disk on
  252. every single track.  Obviously, that will really  slow  down
  253. everything, including COPYFAST.
  254.  
  255.  Note: for CP/M 2.x users with single drive systems and sec-
  256. tor sizes greater than 128, the program now homes  the  disk
  257. before swapping the disk (at label STARTL).  This is to give
  258. the CBIOS a chance to write the last sector.  If homeing the
  259. drive is not enough to cause your CBIOS to empty the buffer,
  260. then  add  any  code at that point that will do so or change
  261. the CBIOS.  I recommend the latter, since homing  the  drive
  262. is  only  done  in  such special cases such as a reboot or a
  263. disk change.
  264.  
  265. ------------------------------------------------------------
  266.  
  267. Quick course in floppy disk functions:
  268.  
  269.  The  IBM 3741 floppy disk has 77 tracks, or positions where
  270. the read/write head can be.  There is always a counter some-
  271. where in the BIOS and/or disk controller  board  that  gives
  272. the  current  position  of  the currently selected disk.  It
  273. usually takes about 15ms to move the head one track  (in  or
  274. out),  and can take up to 120ms to move the heads from track
  275. 76 to track 0.  Track zero, by the way, is  at  the  outside
  276. edge of the disk.  The diskette rotates at 360 RPM, or 167ms
  277. per  revolution.   The  standard format specifies that there
  278. are 26 128-byte sectors, or records, on each track.
  279.  
  280.  A little quick arithmetic will give you the results that it
  281. takes maybe 6ms or slightly longer for one  sector  to  pass
  282. under  the head.  Since the disks are always rotating, there
  283. is always  some sector now under, or about to be under,  the
  284. head.   It  can also take an entire sector for a floppy disk
  285. controller to find where it is, assuming that the disk  head
  286. was suddenly and randomly loaded, or moved to another track.
  287. Furthermore,  many  floppy disk controllers cannot even read
  288. one sector after another, or  perhaps  they  can  read,  but
  289. cannot  write that fast (since writing requires that some of
  290. the gap bytes be written before and after  the  data,  where
  291. reading  can  start  just  after the address mark, and stops
  292. when the first gap byte after the data stops.)
  293.  
  294.  Another major consideration for copy programs  is  that  it
  295. takes  maybe  30ms for the head of a disk drive to be loaded
  296. onto the surface of the diskette, and you dont  like  to  do
  297. that often, since the impact could cause wear.
  298.  
  299.  What does this all mean?  Well, suppose you want to write a
  300. copy  program.   First, you have to tell the controller what
  301. track to start at, and to load the head.   That  might  take
  302. 30ms to load the head and 50ms to move the head to the right
  303. track.   Now, you want to read sector one, but sector one is
  304. not there right now.  You might have to wait 80ms for sector
  305. one to come around.  (there is no CBIOS  command  for  "read
  306. the  next  sector,  whatever  that  is" and some controllers
  307. cannot do it at all) After you have read sector  one,  maybe
  308. you then want to read sector two.  Unfortunately, you waited
  309. too  long  to  decide,  and  the head is now halfway through
  310. sector two.  So, the controller waits 166ms for the start of
  311. sector two to come sround again.  You would have been better
  312. off if you asked for the odd sectors first  (1,3,5...)   and
  313. then  gotten  the even sectors on the next revolution.  That
  314. would take only 334ms all in all.  That is  what  is  called
  315. read interleaving, or skewing for short.
  316.  
  317.  There  is  another  type  of skewing, called track skewing.
  318. That occurs when you have read the last  sector,  sector  26
  319. for  example.   Now,  you order the disk to move the head to
  320. the next track.  That took 15ms, and in that time sectors 1,
  321. 2, and part of 3 rotated by under the head.  So, if you tell
  322. the controller to read sector 1, then you have to wait until
  323. sector 1 rotates by again, about 150ms.  If you could  start
  324. this  read  at  sector 4, and read everyting sfter that, you
  325. would not waste  as  much  time.   That's  track  (or  seek)
  326. skewing.
  327.  
  328.  In order to make a copy in the shortest time, this program
  329. does all of the following:
  330.  
  331. 1. Reads as many tracks as possible into core, and then
  332.     switches to the other drive to write. This will
  333.     minimize the number of times the head on each
  334.     drive has to be loaded.
  335. 2. Does all reads as fast as possible, with any skew that
  336.     is needed to achieve that. The fastest possible is
  337.     no skewing at all, of course. The skewing pattern
  338.     is in a table for easy manipulation.
  339. 3. Does all writes as fast as possible, with any skew that
  340.     is needed. The write skew does not have to be the
  341.     same as the read skew, because some controllers can
  342.     read faster than they can write.
  343. 4. Allows track skewing on the main read so that the track
  344.     can be read with as little rotational delay as poss-
  345.     ible. The read after the write does not need this
  346.     skewing, because there is no movement between the
  347.     write and the following read.
  348.  
  349.  The program does one thing that slows it down: it checks
  350. the data that is written by reading it back. If you are very
  351. confident of the reliability of your system, controller,
  352. and disks you could skip that step. I think that starts at
  353. label WT3 in the program, and the code could be commented
  354. out. On a normal controller, that step adds about 12 sec-
  355. onds to the copy time, and I think it is worth it.
  356.  
  357. ------------------------------------------------------------
  358.  
  359.     Assembly-time variables that can be changed:
  360.  
  361. SINGLE:    TRUE for single drive copy program
  362.  
  363. RSKEW:    TRUE  if  read  interleaving  needed.  If FALSE, the
  364.     program will  read the sectors sequentially  (1,2,3,
  365.     4,...)   When  TRUE, you should modify the read skew
  366.     table (READTAB) to fit your particular requirements.
  367.     Read  skewing is used on the initial read and on the
  368.     read-after-write check.  (This is FALSE for CPYFST3F
  369.     and CPYFST3M and TRUE for CPYFST3S.)
  370.  
  371. TRSKW:    TRUE if  track to track read skewing is desired when
  372.     there is  no read skewing.  TRSKW  may be TRUE  only
  373.     when RSKEW is  FALSE.  TSKEW gives  the value of the
  374.     track sector skew.  (This is  TRUE for  CPYFST3F and
  375.     CPYFST3M and FALSE for CPYFST3S.)
  376.  
  377. DOCOMP:    TRUE  if  byte-by-byte   comparison  is  desired  on 
  378.     read-after-write check.
  379.  
  380. WRSWCH: TRUE if it is necessary to pass your CBIOS different
  381.     values in reg. C during writes. See the CP/M 2.2 Al-
  382.     teration Guide for the purpose of this value in reg.
  383.     C.  If TRUE,  it will be necessary to edit the WRTAB
  384.     table to fit your particular requirements. If FALSE,
  385.     the value in  reg. C will  be that  given in WRCODE,
  386.     normally 2.
  387.  
  388. NUMERR:    The  number of errors before counting as a permanent
  389.     error.  The error counter applies  independently  to
  390.     each  track  read,  but applies to each entire write
  391.     pass.  That is, the program will try  to  read  each
  392.     track NUMERR times, and will quit and then go to the
  393.     next track.  However, when writing, the program will
  394.     stop writing when NUMERR errors have occurred on the
  395.     current   pass,   and  then  it  will  start  a  new
  396.     read/write pass at the track after  the  track  with
  397.     the  write error.  The read and write error counters
  398.     are independent, since they are supposed to  be  two
  399.     different disks.
  400.  
  401. SDLAST:    the number of sectors per track. This value also de-
  402.     termines the size of the  READTAB, WRITAB, and WRTAB
  403.     tables.
  404.  
  405. TSKEW:    The  value  of  the  track to track read skew.  This
  406.     applies only if  RSKEW is FALSE, that  is,  no  read
  407.     sector  skewing.   This  is  to  allow  even  faster
  408.     reads when a fast disk controller chip is used.  The
  409.     reason is this: after the last sector on  the  track
  410.     is  read (usually 26), the program must move the arm
  411.     on the disk to the next track.  This takes time,  of
  412.     course,  and  so the disk has rotated a bit.  So, if
  413.     the next  sector  wanted  is  the  first,  then  the
  414.     program  has  to  wait until the disk has rotated a-
  415.     round all the way back to the  start.   But  if  the
  416.     program  could  then start with sector 8, say, there
  417.     would be no waiting.  Of course, the  program  would
  418.     have  to read sectors 1-7  after reading  number 26,
  419.     and then move the arm.  So,  then  it  should  start
  420.     reading  the next track at sector 13, and so on.  In
  421.     this case, the value of TSKEW  is  7.   The  program
  422.     will  always  start  a  pass on sector one, but will
  423.     not  start at sector one if the track skew  gives  a
  424.     value  greater  than SDLAST.  That is, track skewing
  425.     is a modulus  function.  If TSKEW  is  7,  the poss-
  426.     ible  starting sectors are  1,8,15,22,3,10,17,... if
  427.     SDLAST is 26.  Track skewing is used only during the
  428.     initial  read  from  the  source   disk.    On   the
  429.     read-after-write check, the write skew table is used
  430.     to compensate for the head load and seek times. This
  431.     value is ignored if TRSKW is FALSE.
  432.  
  433. SECSIZ:    number  of  bytes per sector.  Read the comments re-
  434.     garding the sector size below if you plan  to  adapt
  435.     the  program to some other type of disk format.  For
  436.     CP/M compatible BIOS routines, this is always 128.
  437.  
  438. WRCODE:    If WRSWCH is FALSE,  this is the value passed to the
  439.     CBIOS sector write routine in reg. C.  See the  CP/M
  440.     2.2 Alteration Guide for details of this value,  but
  441.     it is normally 2 for this application.
  442.  
  443. FIRSTRK:the first track  copied.  If the  starting track for
  444.     the source and object disks are not identical,  then
  445.     this figure  applies to the object disk.  Note: this
  446.     value is  normally  the track where CP/M  places the 
  447.     directory.  It is assumed that the  bootstrap starts
  448.     at track 0 and ends on track FIRSTRK-1.
  449.  
  450. LASTRK:    the last track copied plus one. The number of tracks
  451.     copied is normally LASTRK-FIRSTRK.
  452.  
  453.     These latter two values specify the copy range,  and
  454.     the program can  be run in other ways  by the param-
  455.     eter given when COPYFAST  is first invoked.  FIRSTRK
  456.     and LASTRK  specify how the  parameter will actually
  457.     be interpreted.
  458.  
  459.  All    0-(Lastrk-1)        Entire disk
  460.  Data    Firstrk-(Lastrk-1)    CP/M data area
  461.  First    Firstrk            CP/M directory track 
  462.  Last    (Lastrk-1)        Last track on disk
  463.  One    1            Track one, UCSD directory
  464.  Pascal    1-(Lastrk-1)        UCSD Pascal data area
  465.  System    0-(Firstrk-1)        CP/M bootstrap
  466.  Zero    0            Track zero, UCSD bootstrap
  467.         (Note: only complete tracks are copied)
  468.  
  469. BUFFNU:    the  number of full track buffers that will fit into
  470.     your system.  This figure includes the space used by
  471.     the read-back buffers, if used.  Zero or minimum 2.
  472.  
  473.     If  you  wish auto-size determination, set BUFFNU to
  474.     zero, and the program will use all space up to,  but
  475.     not  including the CBIOS routines.  With the current
  476.     specification of 26 sectors per track,  the  program
  477.     will  require  at  least  39K  for  buffers alone if
  478.     BUFFNU is 12, and so should  run  in  a  42K  system
  479.     minimum.   (12  *  128  * 26 = 39936 plus 3K for the
  480.     CBIOS and program).   I  recommend  that  BUFFNU  be
  481.     minimum   of   2   if  you  do  not  want  auto-size
  482.     determination.
  483.  
  484. DIFFTRK: is the difference between the source and the object
  485.     track numbers.  That is, this quantity is  added  to
  486.     the  object  track  number  to  get the source track
  487.     number.  This is so that the program can move tracks
  488.     around from one disk to another.  This  is  normally
  489.     zero.   DIFFTRK is ignored in a single-disk program.
  490.  
  491.     For example, to copy tracks 25 to  49  from  a  UCSD
  492.     Pascal  disk to tracks 0 to 24 of an empty disk, set
  493.     FIRSTRK to zero, LASTRK to 25 (24 plus 1), and  then
  494.     DIFFTRK has to be 25(source) - 0(object), or 25.
  495.  
  496.     DIFFTRK is used  only when the default copy range is
  497.     used.  If one of the range  parameters is specified,
  498.     then DIFFTRK will be set to zero automatically.
  499.  
  500.  The last four  quantities are in  single-byte  constants in
  501. the program, and can be modified by DDT to alter the charac-
  502. teristics of the program to suit your needs.  They are found
  503. at label TRKSRT in the program, at locations :
  504.     FIRSTRK        12D
  505.     LASTRK        12E
  506.     BUFFNU        12F
  507.     DIFFTRK        130
  508.  I change these values  to create various  versions of Copy
  509. programs. These  values are defaults, and they are not used
  510. if the  range parameter is  specified,  (or in  the case of
  511. BUFFNU, if CP/M is too small).
  512.  
  513.  
  514.  Note: some distributors  of  CP/M  (such  as  Micromation),
  515. supply a CBIOS that alters the BDOS routines, whether or not
  516. the  BDOS  is  present  there.   This  means that you cannot
  517. safely let COPYFAST take all space up to the CBIOS,  because
  518. the  CBIOS will modify the contents in the highest buffer in
  519. the mistaken idea that the  BDOS  is  there.   This  usually
  520. means that the CBIOS cannot be used for UCSD Pascal, either.
  521.  
  522.  
  523.  Note:  if you are modifying this program for use with other
  524. than 128 byte sectors, and this has been done  successfully,
  525. you  MUST  change the code at labels RT3, WT3, and WT4.  The
  526. change generally consists of adding a few more DAD  H  lines
  527. to  the code.  There are currently 7 of these, since 128 = 2
  528. to the 7th power.  If you are going to  be  processing  1024
  529. byte  physical sectors, then add 3 more DAD H instruction to
  530. each of the three places indicated, because 1024 = 2  ^  10.
  531. Do  not  change  the  number if you are running with a CBIOS
  532. written to  deblock  the  physical  sectors  into  128  byte
  533. logical  sectors,  as  all  CP/M 1.x and 2.x compatible BIOS
  534. routines do.  In such cases, the  number  of  "sectors"  per
  535. track is changed instead, exactly the same as CP/M itself is
  536. told.   The  CBIOS in that case will put the logical sectors
  537. into one physical sector before doing the write.  It will of
  538. course be necessary to change  the  sector  skew  tables  to
  539. something   that   matches  the  capabilities  of  the  disk
  540. controller and the blocksize.  You must  understand  exactly
  541. how your CBIOS blocks and deblocks from the physical sectors
  542. before you can make up a good skew table.
  543.  
  544. -------------------------------------------------------------
  545.  
  546.  Alternate interleave table for slower controllers.
  547.  
  548.  The sectors are listed in the order they will be written to
  549. disk.  NOTE: the peculiar ordering is due to the  fact  that
  550. some  disk  controllers cannot switch between writing sector
  551. 26 and reading sector 1 in time - so the table  begins  with
  552. 25,  proceed up every other sector, and ends with number 24.
  553. While the head is passing sectors 25  and  26,  the  program
  554. will  be  switching to read back the entire track.  There is
  555. generally no problem starting with sector 25, because simply
  556. moving the head after the previous read on most drives  will
  557. take  about  one half revolution.  This table was determined
  558. empirically using Shugart drives and doing actual tests with
  559. two different types of controller  boards,  and  it  is  the
  560. fastest variation found.  Change at your own risk.
  561.  
  562.     DB    25,1,3,5,7,9,11,13,15,17,19,21,23
  563.     DB    26,2,4,6,8,10,12,14,16,18,20,22,24
  564.  
  565. (This table is used in CPYFST3M.COM and CPYFST3S.COM)
  566.  
  567.  The  following  table  is  recommended  for   those   whose
  568. controllers  cannot write even every other sector.  There is
  569. no peculiar starting sector here because the interleave ends
  570. on sector 24, and that is the same as the table above.  This
  571. might be a better choice for a "universal" table.
  572.  
  573.     DB    1,4,7,10,13,16,19,22,25
  574.     DB    2,5,8,11,14,17,20,23,26
  575.     DB    3,6,9,12,15,18,21,24
  576.  
  577.  It is likely that if you require one of the alternate write
  578. skew tables, then you will also have to have read skew.  So,
  579. you should also make RSKEW equal to TRUE and modify the read
  580. skew table to run as fast as possible.
  581.  
  582. -------------------------------------------------------------
  583.  
  584.  Users  of  double-density  controllers may be interested in
  585. what I did with mine.  My BIOS is written so that  a  double
  586. density disk is considered as two single disks, that I refer
  587. to  as  "the  front  half"  and "the back half".  With three
  588. drives, A, B, and C are the fronts, and D, E, and F are  the
  589. back.   A single density disk is only front.  Each track has
  590. 3328 bytes (26*128) bytes of data for the  front  half,  and
  591. 3328  bytes for the back half.  The way COPYFAST works makes
  592. it possible  to  copy  the  front  half  to  the  back,  and
  593. vice-versa,  and  I  dont  have  a  lot of funny versions of
  594. programs written exclusively for a particular density  disk.
  595. Two "disks" per floppy also means twice the directory space.
  596. My  BIOS  is also written to check the disk density whenever
  597. the disk in HOMEd, which COPYFAST does before starting.  The
  598. only hardware dependencies in my  system  are  in  the  disk
  599. initialization program and in the BIOS.
  600.  
  601. ------------------------------------------------------------
  602.  
  603. Suggestions for improvements:
  604.  
  605. 1. Ask if you really wanted to copy a disk if track 2
  606.    (the directory) was completely empty i.e. all E5's
  607. 2. Better error checking .. the program reports only
  608.    one comparison error per track right now.
  609. 3. Have an option where it only compares two disks to
  610.    see if they are the same.
  611. 4. Check for CP/M 2. If so, use the disk attribute table
  612.    for information like number of sectors, number of
  613.    tracks, etc.
  614. 5. Could this thing be modified for hard disk backups?
  615.  
  616.