Transferring MSDOS files to the TS2068

Authors

Publication

Pub Details

Date

Pages

See all articles from Sinc-Link v8 n3

Recently I was given an MSDOS disk by Bill Harmer, of Ottawa, to see what I could do with it. This article describes my experience with transferring this and subsequent MSDOS files to the TS2068 using the Larken LKDOS.

When I first received the disk I found that the Larken disk system, as I expected, would not touch it; instead it reported CRC errors. I then went at it with the “doctor.B1” utility (to be found on our club library disk #1.) I found, to my delight, that although the LKDOS reported a CRC error, the selected track had in fact been loaded into the computer. A good start.

I inspected the data and found that it was a text file and that it continued, without a break, for 4608 bytes. Where the Larken holds 5090 bytes of data per track the MSDOS disk held 4608 (256*18=4608) bytes. It also appeared that on this disk the data was not broken up into separate sectors. Or if there were sectors, the sectors were contiguous and the text files uninterrupted.

Since it seemd likely that the only useful data on an MSDOS disk would be text files, the thought was to create a file suitable for a word-processing program. Two WP programs came to mind, Tasword and Mscript. After some experimentation Mscript was selected. This was primarily because Mscript appeared to be more amenable to editing of the raw material.

The “track-loading” function of “doctor.B1” was extracted to become the “heart” of a new program called “MSDOS.Bx”. Mscript can handle files of 16301 bytes. To make optimum use of Mscript it seemed appropriate that the new files be designed to hold the data from three tracks (3 * 4608 = 13824).

The new program was arranged to load three successive tracks. After loading the first track the 4608 bytes of data, initially loaded at starting address 45000, were transferred via a m/c LDIR routine to starting address 51200. When the second track was loaded, it’s data was transferred so it was above, and contiguous to the initial block of data. Same for the third track. We now had a continuous block of 13824 bytes of data starting at address 51200.

This block of data was then saved by a simple LKDOS SAVE routine to a disk in a second drive on the system. Then the cycle was repeated, with the next three tracks of the MSDOS disk being saved in the same manner. This process would continue automatically and without interruption until the whole disk had been copied out.

Now, there were complications of course. First, it was found that these files, though of ASCII text, often contained “nulls”, that is to say zero (0) values. Mscript, when it encounters a null, takes this to mean “end-of-data”, and for all intents and purposes thats it; Mscript says that’s all the data in that file. Initially, a Basic FOR/NEXT routine was used to go through the text file, replacing all the nulls with a value of 32 (a space character). This was successful, but it took what seemed like forever to work through 13824 bytes of an Mscript file.

A m/c routine was then developed to do this task while the data was still in the computer, before it had been saved as a Mscript file. The Basic part of the program was modified to allow the user to designate the value to be searched for, and it’s replacement. The program was later expanded to allow as many such changes to be made as desired. This “search and replace” routine, being in m/c, took probably less than a second to complete.

It was found useful to remove all values of 10 (Carriage Return) as well; this made editing the Mscript file easier. In practice these seem to be the only two values that are usefully removed.

Another complication was encountered. The first disk was double-sided, so the program was written to read all 79 tracks (Track 0 was not looked at, it being presumed to have no text on it). However the next disk turned out to be single-sided. The effect on the files was a repetition of data. Where an attempt to load an odd-numbered track was made, no fresh data was loaded into the computer; the data from the previous track being captured a second time. The program was modified to cope with this, by having the user indicate disk type.

Now, each Mscript file that was being saved needed a unique name. This was handled by fixing the 6th character of the Larken file name as “A” for the first file, and incrementing it to the next letter of the alphabet with each successive SAVE. This gave 26 files before one ran into “odd” characters such as “]”, etc., and was adequate to handle all the tracks on a DSDD disk (3*26=78).

Sometimes it would not be known whether a DS or SS disk was being worked on. Also, in many cases only a small number of the tracks on a disk had any data on them. It was desirable to provide a means of inspecting individual tracks on the disk to obtain this information. A routine was incorporated in the Basic program which would load a selected track, and display the contents onscreen in ASCII character form. Where non-ASCII data was encountered an asterisk (*) would be printed. This gave some indication of the extent of non-text material the tracks contained.

It should be kept in mind that although the material has been transferred successfully into an Mscript file, it still needs considerable effort to edit it. Probably the majority of text files in MSDOS disks are 80-characters-per-line, with a CR (Carriage Return) character at the end of each line, which must be edited out to make the text useful. Nevertheless, this effort would be considerably less that that required to retype such material from a prinout.

As a matter of interest a QL disk was also checked, using this program. It was found that while the QL disk could be loaded in the same manner, that the data on a track was present in blocks (sectors?) which were not contiguous. That is to say the individual blocks of data (maybe 256 bytes per block) had not been saved consecutively along the track. Thus it seemed hardly worthwhile pursuing this aspect.

Products

 

Downloadable Media

 

Image Gallery

Source Code

  100 REM   A utility to move               MSDOS text files                     to the                    Larken LKDOS(TS2068)     
  110 REM  Written and placed             the public domain by      
  120 REM    G. Chambers                     14 Richome Court                Scarborough, Ont.               CANADA M1K 2Y1         
  130 REM  For version 3 LKDOS       
  140 REM For use with Larken and         MSDOS DSDD (360K)disks     
  150 RANDOMIZE USR 100:OPEN #4,"dd"
  160 LET oo=0:LET oa=1:LET ob=2:LET oc=3:LET od=4:LET oe=5:LET of=6:LET og=7:LET oh=8
  170 BORDER oa:PAPER oa:CLS 
  180 ON ERR RESET :CLS :GO SUB 1000
  210 PRINT AT 12,3;"Wait a moment...."
  220 RESTORE 250
  230 FOR n=44000 TO 44160:READ a:POKE n,a:NEXT n
  240 PRINT AT 12,3;"                   "
  250 DATA 195,249,171,195,7,172,195,27,172,195
  260 DATA 56,172,195,75,172,243,205,98,0,201
  270 DATA 58,100,0,251,201,205,239,171,58,124
  280 DATA 171,50,29,32,205,126,0,24,237,205
  290 DATA 239,171,58,124,171,50,29,32,205,129
  300 DATA 0,58,29,32,50,124,171,24,217,205
  310 DATA 239,171,175,50,32,32,205,123,0,58
  320 DATA 32,32,79,6,0,33,112,32,17,200
  330 DATA 175,1,0,20,237,176,24,188,205,239
  340 DATA 171,33,200,175,17,112,32,1,0,20
  350 DATA 237,176,205,120,0,24,169,205,239,171
  360 DATA 42,144,171,78,35,70,24,158,0,0
  370 DATA 33,200,175,17,0,200,1,0,18,237,176,201,0,0,0
  380 DATA 22,0,30,0,33,254,199,35,126,1,0,254
  390 DATA 167,237,66,9,208,186,32,243,115,24,240,0,0,0,0
  410 LET settrack= VAL "44000"
  420 LET nexttrack= VAL "44003"
  430 LET load= VAL "44006"
  440 LET save= VAL "44009"
  450 LET track= VAL "43900"
  460 LET drive= VAL "43301"
  470 REM LET buffer=VAL "50000":LET bufflenth=VAL "5120":LET lastcell=VAL "3571":LET diskname=4483
  480 POKE drive,ob
  490 LET treg= VAL "18"
  500 INPUT "Orig. Drive (MSDOS) ";orig
  505 INPUT "1)Side or 2)Sides to Disk";q:
  507 ON ERR RESET :POKE 23658,8:INPUT "Inspect MSDOS disk? ";y$:IF y$ <>"Y" AND y$ <>"N" THEN GO TO 507
  508 IF y$="Y" THEN GO SUB 860:GO TO 507
  510 INPUT "Dest. Drive (Larken) ";dest
  520 INPUT "Name for Mscript File(max 5) ";a$:IF LEN a$>5 THEN LET a$=a$( TO 5)
  530 LET a=64:LET m$=""
  550 LET count=oa:INPUT "Start transfer at track No.? ";count
  560 INPUT "Ending at which track #? ";end
  570 INPUT "Modify File? ";y$:IF y$="N" OR y$="n" THEN GO TO 590
  580 GO SUB 910
  590 PRINT AT VAL "21",og;"(Press M to stop program)":PRINT AT oc,oo
  595 LET step=3:IF q=1 THEN LET step=6
  600 FOR t=count TO end STEP step
  610 RANDOMIZE USR 100:GO TO orig
  620 POKE track,t:RANDOMIZE USR settrack
  630 LET move=200
  640 CLS :PRINT AT 3,1;"MSDOS to Larken File Converter"
  650 FOR w=1 TO 3
  660 IF INKEY$ <>"" THEN LET m$= INKEY$
  670 RANDOMIZE USR load
  680 RANDOMIZE USR nexttrack
  685 IF q=1 THEN PAUSE 6:RANDOMIZE USR nexttrack
  690 POKE 44125,move:LET move=move+18:REM Relocating data
  700 RANDOMIZE USR 44120
  710 NEXT w
  720 RANDOMIZE USR 100:GO TO dest
  730 FOR n=1 TO change
  740 POKE 44136,d(n):POKE 44138,e(n)
  750 RANDOMIZE USR 44135:REM    Modify selected numbers in the textfile: i.e. nulls and/or CR'sfrom the text file before savingit to an Mscript file. 
  760 NEXT n
  770 IF m$="m" THEN STOP 
  780 LET a=a+1:LET b$= CHR$ a:LET c$=a$+b$+".CM"
  790 PRINT AT 19,3;"Saving... ";c$ 
  800 RANDOMIZE USR 100:SAVE c$ CODE 51200,13824
  810 NEXT t
  820 PRINT AT 21,oo;" Last track-Press key to stop":PAUSE oo
  830 STOP 
  860 INPUT "Inspect which track? ";count
  865 PRINT #4:GO TO orig
  870 POKE track, count:PAUSE 6:PRINT USR settrack:PAUSE 6:PRINT USR load
  880 ON ERR GO TO 507:CLS :PRINT FLASH 1;"Scanning track"; FLASH 0:FOR N=45000 TO 49608:IF PEEK n>31 AND PEEK n<126 THEN PRINT CHR$ PEEK n;:GO TO 890
  882 REM PRINT "*";
  890 NEXT n
  900 RETURN 
  910 INPUT "Number of changes to be made ";change
  920 DIM d(change):DIM e(change)
  930 FOR n=1 TO change
  940 INPUT "Remove which No.? ";d(n)
  950 INPUT "Replace with No.? ";e(n)
  960 NEXT n
  970 RETURN 
 1000 PRINT AT ob,oc; INK ob; PAPER og;" LARKEN DISK UTILITY v1.4 "; AT od,oc; INK og; PAPER ob;" MSDOS to LKDOS Converter "; AT of,od;" © 1990 George Chambers "
 1010 INK og:PLOT oo, VAL "108":DRAW oo, VAL "62":DRAW VAL "255",oo:DRAW oo, VAL "-62":DRAW VAL "-255",oo
 1020 INK og:PLOT oh, VAL "114":DRAW oo, VAL "50":DRAW VAL "238",oo:DRAW oo, VAL "-50":DRAW VAL "-238",oo
 1030 RETURN 
 8000 INK 0:PAPER 7:BORDER 7:CLS :LIST :STOP 
 8999 STOP 
 9000 CLEAR :LET od=4:POKE 23658,0:PRINT AT 13,9;"SAVE ROUTINE"''" Press ""D"" key to save to disk,"'' "    or ""T"" key to save to tape":PAUSE 0:IF INKEY$="d" THEN INPUT "Drive #? ";dr:PRINT #od:GO TO dr
 9010 IF INKEY$="t" THEN LET od=2
 9020 PRINT #od:SAVE "MSDOS.Bx" LINE 150:RUN 
Scroll to Top