background image

Summary of Contents for CBM 2040

Page 1: ...fRopei Ty OF TEST vu lv fc r User s Manual for GBM 5y4 lnGh Dual Floppy Disk Drives CBlVr ftopp modw dSk QglVI floPPV eonmodere veonwnodoPB CBIWI...

Page 2: ...Model 2040 Model 4040 Model 3040 Model 8050 Appropriate for use with Commodore Computers Series 2001 CBM PET Series 3000 CBM Series 4000 PET Series 8000 CBIVI Part Number 320899 October 1980 commodor...

Page 3: ...Power On Test 12 Inserting The Diskette Into The 8050 13 liisi fliii j Till IJiiiktiUe liilu Tlie HO IO ijO lO uml 10 1 Iit The 4040 and 8050 Performance Test 14 The 2040 and 3040 Performance Test 17...

Page 4: ...PEN 39 CLOSE 39 DCLOSE 40 Closing The Command Channel 40 Closing The Data Channel 41 PRINT 41 INPUT 42 GET 43 RECORD 43 Quickload Feature BASIC 4 0 44 Moving a Tape Program to Disk 45 Chapter 5 Advanc...

Page 5: ...VI 13 14 15 16 17 Directory Format 0q Sequential Format Program File Format 61 Relative File Format 70 User s Quick Reference Disk Commands 87...

Page 6: ...User s Quick Reference Disk Commands 86 Chapter 9 Random 1 00 Program Listing 89 Chapter 10 Index 95 Figure 1 2 3 4 5 Table 1 2 3 4 5 6 7 8 9 10 11 12 List of Illustrations Title Page Models 2040 3040...

Page 7: ...cept forms the basis of this manual teachingyou how to gainmastery of the system so that it will perform asdesired That isthe primary reason this manual islaid out in a building block fashion it permi...

Page 8: ...th the advanced subjects such as random access or relative files while others may be content with just following the manual s format In either case this manual has been laid out to provide the user wi...

Page 9: ...Because each device is an intelligent peripheral their operation requires no space in the computer s memory This means you have just as much computer memory available to you as when you do not have t...

Page 10: ...uage 2 Digital Equipment Corp Maynard MA 01754 101 BASIC Computer Games Software Distribution Center Digital Equipment Corp Maynard MA 01754 What do To After You Hit Return Peoples Computer Co 1010Doy...

Page 11: ...s of the 5 1 4 inch diskettes You should make sure that you buy diskettes for SOFT SECTORED FORMAT Your Commodore dealer can supply your needs Specifications Table 2 presents the specifications for th...

Page 12: ...r file 65535 records per file 224 per diskette 23 to 29 256 77 2083 IC s Controller 6502 6530 6522 microprocessor I O RAM ROM I O interval timers Interface 6502 6532 2 6564 2 microprocessor I O RAM in...

Page 13: ...90 IC s Controller 6504 6530 6522 microprocessor I O RAM ROM I O interval timers Interface 6502 6532 2 6332 2 microprocessor I O RAM interval timers ROM Shared 6114 8 4xlK RAM PHYSICAL Material 18 ga...

Page 14: ...IC s Controller 6504 6530 6522 microprocessor I O RAM ROM I O interval timers Interface 6502 6532 2 6332 2 microprocessor I O RAM interval timers ROM Shared 6114 8 4xlK RAM PHYSICAL Material Dimensio...

Page 15: ...acket with a lead pencilor ball point pen Use a felt tip pen or fill out the label before attaching it to the jacket 5 Do not expose diskettes to heat or sunlight 6 Do not touch or attempt to clean th...

Page 16: ...NOTES 10...

Page 17: ...cable if your diskdrive isto be connected daisy chained to anotherperi pheral device such as theCommodore Model 2022 orany other suitable interfaced printer NOTE The disk driveshould be the first peri...

Page 18: ...Cable P N 905080 Figure 2 Floppy Disk Hookup PERFORMING THE POWER ON TEST You arenowreadyto proceed witli thepoweron partofthe checkout STEa 1 Openbothdiskdrivedoors Ensurethat nodiskettesarepresenti...

Page 19: ...ase the diskette and push it out toward the front of the drive The diskette is now free to be removed from the drive STEP 5 DO NOT ATTEMPT TO CLOSE THE DOOR WITHOUT A DISKETTE IN PLACE The door is loc...

Page 20: ...th your disk unit command This is to be expected pressthe RETURNkey oVyoi rke followed byacarriagereturn S inre xirifth7e 1nd1crrH S example anyway Re nter younas c Tf he successful and you may contin...

Page 21: ...l display STEP 6 Type RUN and press RETURN The program instructs you to place a blank diskette into each drive The Per formance Test Program executes a shortened version of the test used by Commo dore...

Page 22: ...ILE ON 0 FILES SCRATCHED 1 5 RATCH file ON 1 files SCRATCHED 1 WRITE TRACK xx ON 0 hdJJI ON 1 WRITE TRACK 1 ON 0 WRITE TRACK 1 ON 1 RERIf TRACK xx ON 0 READ TRACK xx ON 1 RERD track 1 ON 0 READ TRACK...

Page 23: ...may continue STEP 1 Insert the DEMO diskette intodrive 0 aspreviously instructed Insert a blank diskette into drive 1 Close both drive doors STEP 2 Type OPEN 1 8 15 This command opens logical file 1o...

Page 24: ...Diagnostic Boot program from the diskette in drive 0 into memory The screen displays your entry and Concurrent with the display the drive 0 indicator lights and the drive 0 motor runs STEP 9 REMOVE T...

Page 25: ...plays your entry and STEP 15 Type RUN The PET DISK program is displayed until terminated Note that you can hear the drive 0 motor running intermittently as each program loads the next STEP 16 Press th...

Page 26: ......

Page 27: ...s described inthischapter apply specifically to the 2040 3040 4040 and 8050 Certain of the commands and statements may follow aslightly dif ferent format orproduce different results from those describ...

Page 28: ...lable for the BAM onlyoneblock of the BAM isloaded into memory at a time When updated thisblock is written to the disk andthe other block loaded into memory This interchange of information between the...

Page 29: ...er methbd to communicate virith the disk Chapter 7 contains detailed instructionsconcerningthe useof these special symbolsand their limitations DISK MAINTENANCE COMMANDS Thefollowing disk commands per...

Page 30: ...he block headers writing the sync characters disk ID and track and sector numbers at the beginning of each block The directory headerand the BAM arecreated and the diskette ismade readyto acceptdata T...

Page 31: ...previously opened file was addressed with a second OPEN command If the file is still open the second OPEN command would close the file If this error is displayed retype the OPEN command and proceed T...

Page 32: ...mber of available free blocks There are two methods available to all users for listing the directory The first method illus trates the listing procedure using LOAD and the second the listing procedure...

Page 33: ...e diskette into the drive to obtain this information Should you desire to print the directory place the diskette in drive 0 and enter the following commands LOAD 0 8 Loads the directory OPEN 4 4 CMD4...

Page 34: ...mand formats the destinationdiskette and transferseach block of in formation from the source diskette to the destination diskette thus creating an exactdupli cate of the source diskette Usethis proced...

Page 35: ...sdr is the source drive either 0 or 1 Note that the format of BACKUP differs from DUPLICATE in that the order of the drives is reversed Example BACKUP D1 TO DO This has exactly the same effect as the...

Page 36: ...example 2 files from both drives are concatenated into afile ondrive 1 Inexample 3 all files from drive 0 are copied todrive 1 An error message FILE EXISTS will be generated in thedisk unit ifa file...

Page 37: ...ll containthe contents of both dfn and sfn after the concatenation For example CONCAT DO YOURFILE TO D1 MYFILE will result inMYFILE ondrive 1 containing the datafrom the oldMYFILE and from YOURFILE YO...

Page 38: ...files from the specified diskette and itsdirectory You can erase one file severalfiles or all the files on a diskette The format of SCRATCH is PRINT lfn Sdr fn dr fn dr fn Where dr is the disk drive...

Page 39: ...me of file to be scratched Pattern matching rules may beused with this command As with theHEADER command there isa built in safety feature that queries the user ARE YOU SURE Apositive response permits...

Page 40: ...NOTES 34 n...

Page 41: ...fn file name supplied by user x dr disk drive number 1 or 0 both Dx and dr default to 0 8 device number 8 for disk 2 for second cassette 4 for printer sa secondary address lf logical file All upper c...

Page 42: ...tte Blanks arecounted ascharacters dn is the device numberand it must be 8 This following example illustrates creating aone line program SAVEinc iton the disketfp in drive 0underthe name TESTPROG and...

Page 43: ...ul LOAD or DLOAD closes all open files Therefore you must give a new OPEN command in order tocontinue communicating with the disk drive command and error channel The format of VERIFY command is VERIFY...

Page 44: ...lete OPEN command is OPENlfn dn sa dr fn ft mode Where lfn the logical file number dn the device number in this case8 sa the secondary address Itmay be any number from 2to 14 and may be used either fo...

Page 45: ...ative files or sequential files of fixed length The format of DOPEN is DOPEN lfn fn Ddr Lrl 0NUdn W i Where Ifn fn and dr arethe same asdefined for OPEN Lrl defines the recordlengthasequalto rl ONUdn...

Page 46: ...THE COMMAND CHANNEL Closingthe command channel closes all channels associated with the disk drive No other part of the logical file environment is affected That is the computer does not recognize that...

Page 47: ...in Chapter 3 of this manual r J v PRINT may also beused to transmit datato a previously opened sequential orrelative file Asemicolon must beused asa terminator foreach PRINT statement when using BASI...

Page 48: ...A or INPUT lfn A v Where lfn afile previously opened using secondaryaddress 15 A astringvariable which will conts the data transferred A anumeric variable which will contain the data transferred INPUT...

Page 49: ...ch is unacceptable for the INPUT command strings longer than 80characters lFor example klOAA S 20 FOR 1 1 TO 254 30GET lfn A 40 AA AA A L 50NEXT result in a ring of length 254 being ix f erred from th...

Page 50: ...with aretrofitted 2040 is command loads the first file on thedisk indrive 0 into memory To ensure thatthe first program on the diskette isaccessed the command mustbe the firstdiskcommand given after a...

Page 51: ...ter s memory and printed It is assumed that the BASIC program was previously stored on the cassette Example Load the file from the cassette tape to the computer s memory Createa program file containin...

Page 52: ...NOTES 46...

Page 53: ...l structure to searchthe directory and to delete and copy files The common memory between the disk controller and thefile interface controller isused as 256 byte buffer areas Three of thesixteen buffe...

Page 54: ...BLOCK FREE B F B F dr t s memory write M W M W adl adh nc data memory read M R M R adl adh memory execute M E M E adl adh USER U Ui parms Where ch the channel number in DOS identical to the secondary...

Page 55: ...be given NOTE If using a 4040initialize thedisk before the buffer read or write Examples BLOCK READ 2 1 4 0 B R 2 1 4 0 B R 2 1 4 0 B READ 2 1 4 0 Parameters following the key words within quotation...

Page 56: ...command is replaced by the U2 command for the 4040 BLOCK EXECUTE designed routines to reside on diskand be Inw r f E is really aB R with an addition The FUe fcterface Controller begins execution of th...

Page 57: ...itwill not be overwritten Ifthe block is allocated the error message will also indicate the next available block Example INPUT 15 EN EM ET ES Reads the next track and sector respectively into ET and...

Page 58: ...xample M E CHR 128 CHR 49 Requests the execution of code beginning at 3180 USER This command provides a link to 6502 machine code according to a jump table pointed to by the special USER pointer Refer...

Page 59: ...B 130C 130C U8 UH jump to DOOE 130F 130F U9 UI jump to D0D5 10F0 10F0 U UJ power up vector U3thru U9 commands are user defined Thelocationsjumpedto are locatedin the buffer areas of RAM androutines ma...

Page 60: ...19 Oto 17 Oto 16 21 20 18 17 4040 Track number Block or Sector Range Total Ito 17 18 to 24 25 to 30 31 to 35 Oto 20 0 to 18 Oto 17 Oto 16 21 19 18 17 8050 Track number Block or Sector Range Total Ito...

Page 61: ...lag for future DOS use Bit map of available blocksfor tracks 1 35 l available block O block not available eachbit represents one block Track 18 Sec tor 0 BYTE CONTENTS DEFINITION 144 161 Disk name pad...

Page 62: ...1 35 l avaaable block O block not available each bit represents one block Table 10 4040 DIRECTORY HEADER Track 18 Sector 0 BYTE CONTENTS DEFINITION 144 161 Disk name padded with shifted spaces 162 16...

Page 63: ...tor of first BAM block 2 67 ASCII character Cindicating 8050 format 3 0 Null flag for future DOS use 4 5 0 Unused 6 21 Disk name padded with shifted spaces 22 23 160 Shifted spaces 24 25 Disk ID 26 16...

Page 64: ...Sector 3 BYTE CONTENTS definition Track and sector of first directory block ASCII character Cindicating 8050 format Null flag for future DOS use track number represented this BAM block Highest track...

Page 65: ...CTORS TRACK TOTAL SECTORS ZONE BAM AREA 1 39 29 1131 1 1 40 50 27 297 2 1 51 53 27 81 2 2 54 64 25 275 3 2 65 77 23 299 4 2 29 DIRECTORY 2 BAM 2052 BLOCKS AVAILABLE When the DOS requires access to a B...

Page 66: ...y 4 130 159 File entry 5 162 191 File entry 6 194 223 File entry 7 226 255 STP F Tr rr TT I ira File entry 8 BYTE CONTENTS DEFINITION 0 128 type YPEr 1 SEQential 2 PROGram 3 USER 4 RELative 1 2 Track...

Page 67: ...ck 2 256 254 bytes of data with carriage returns asrecord terminators Table 15 PROGRAM PILE FORMAT BYTE DEFINITION 0 1 Track and sector of next block in program file 2 256 254 bytes ofprogram info sto...

Page 68: ...int nrtrthelocatio iffhf TT system to retrieve data from non contieuous bIork R f pointers enable the file triggersasearchforTn ZwhSf a related blocks until the entire filp ic jieeamki j J j utilizes...

Page 69: ...a file triggers asearch for the next data block which in turn utilizes block pointers tolocate r ed blocks until the entire file isassembled and made available for display All PRG SEQ and USR files u...

Page 70: ...f9 S310N J...

Page 71: ...able buffer isallocated to channel 4 The second example is an attempt to allo catebuffer 12 to the channel If the buffers arenot available a NO CHANNELS errorcon dition is generated The explicit buffe...

Page 72: ...lication might take advantage of the B R and B Wcommands 1 I random access program entitled Random It f P scheme and providSk access through IC programming Most of the programming below Une 2000 is Sl...

Page 73: ...2 Type 10 and press RETURN For this example ten was entered since this is the MAXIMUMnumber of records the file can contain If lessrecords are needed specify a number less than ten The screen displays...

Page 74: ...GATOSCA 95030 PERJPH En efacomment For example MANUFACTURES r UiRIPHERALS and pressRETURN STEP6 WHOSE RECORD DO YOU WISHTX SEE The screen displays aDD RECORD ame For example JONES and press PHONE Ent...

Page 75: ...excessive look up time Both DOS 2and 2 5 4040 and 8050 are capable ofhandling relative files and should signi ficantly reduce the amount of timespent retrieving diskfiles The two maincomponentsof a re...

Page 76: ...nH if th J foUowed by 00 binary aU zeros to MIU Oof PartiaUyfiUed recordsarepadded with DEFINITION Track and sector ofnext side sector block Side sector number 0 5 Record length Track and sector of fi...

Page 77: ...NT statement the data block is not immediately written out Itis only witten outwhen theDOS moves beyond the particular data block inwhich that record resides This can occur through successive printing...

Page 78: ...the file pointer to record number 100 which does not yet exist The 3n raSn rPret as awarmng rather than an error condition This message is normally expected to occur asa f he first time and indicates...

Page 79: ...tors are also created Side sectors are transparent to the usersince they are automatically generated and accessed by the DOS ACCESSING A RELATIVE FILE In order to make the relative filesystem practica...

Page 80: ...ntationofthe contentsofrecord number 12345678901234567890123456789012345678901234567890 FIELD 1 FIELD 2 PTRr n z Where representsacarriagereturn CHR 13 E it s s rsfrs ris r i that while itis possible...

Page 81: ...ted if the file is to be accessed sequentially which savestime during program execution An example of this occurs when writing a large data base to the disk file Assume that the program has already di...

Page 82: ...NOTES n n 76 r...

Page 83: ...first file on the TEST DEMO diskette contains a program called UNIVERSAL WEDGE often referred to as DOS SUPPORT This program when loaded into memory takes care of the tasks mentioned above If your co...

Page 84: ...plesin thismanual use the Examples 10 is the same as PRINT 1 I0 S0 FILE1 is the same as PRINT 15 S0 J lLEl The OPEN statement isNOT required before astatement th 5 loaded LOAD dr 8 but this command de...

Page 85: ...SUPPORT INFORMATION The DOS SUPPORT program has certain limitations These are 1 The program must be reaccessed from the disk whenever resetting the computer 2 DOS Support may only be used when commun...

Page 86: ...NOTES n 80...

Page 87: ...MMODORE DISK DRIVES The execution of the following program displays the error on the computer screen and resets the device error indicator CBM Series 2001 CBM Series 3000 with BASIC 3 0 CBM Series 800...

Page 88: ...exists 64 File type mismatch 65 No block 66 Illegal track or sector 67 Illegalsystem track or sector 70 No channels available 71 Directory error 72 Diskfull or directory full 73 Power upmessage or wr...

Page 89: ...rotect tab over the notch 27 READ ERROR checksum error in header The controller has detected an error in the header of the requested data block The blockhasnot beenreadinto the DOS memory Thismessage...

Page 90: ...Record position within a relative file indicates that disk overflow will result 60 WRITE FILE OPEN V This message isgenerated when a write file that has not been closed isbeing opened for reading 61 F...

Page 91: ...ted on one version cannot be written upon with the other version because the format is different This error is displayed whenever an attempt is made to write upon a disk which has been formatted m a n...

Page 92: ...ion will result if attempted USER S QUICK REFERENCE DISK COMMANDS Theuser s quick reference guide will assist the user in becoming familiar withthe various commands used inboth BASIC 3 0 and BASIC 4 0...

Page 93: ...already been typed for all of the PRINT com mands in the following formats Commands may be spelled out or abbreviated by the t letter as illustrated PRINT l Ix INITLIALIZE Ix PRINT l Ix PRINT Vdr VAL...

Page 94: ...NOTES 88...

Page 95: ...EL 21 Cl 3 REM SEQUENTIAL CHANNEL 25 CC 15 REM COMMAND CHANNEL 30 D 0 REM CURRENT DRIVE 31 T 0 REM CURRENT TRACK 32 S 0 REM CURRENT SECTOR 35 DD 0 REM DESCRIPTOR DRIVE 36 RD 0 REM RANDOM DRIVE 40 ID R...

Page 96: ...CC U1 C0 d T s 215 PRINT CC B P C0 RP 220 F0RCF 1T0NF 225 GOSUB500 230 NEXTCF 235 PRINT CC U2 C0 D TjS 240 GOSUB1000 IFETHEN1900 245 RETURN 300 REM 301 REM READ RECORD CR 302 REM 305 GOSUB900 310 PRI...

Page 97: ...0THENRETURN 790 GOTO1900 800 REM mmmmmmmmmmmm 801 REM CHECK MAX SECTOR 802 REM 810 IFT 35THEN1900 820 E 0 1FT 0THEN 40 GOTO1900 840 A3 16 IFT 30THEN880 850 A3 17 IFT 24THEN880 860 A3 19 IFT 17THEN880...

Page 98: ...i A0 NEXT 1180 CLOSECl CLOSEC0 RETURN 1200 REM 1201 REM OPEN RELATIVE FILE 1202 REM INPUT F FILENAME 1203 REM DD DESCRIPTOR FILE DRIVE 1204 REM RD RANDOM DISK DRIVE 1205 REM DRIVES MUST BE INITIALIZE...

Page 99: ...5 PRINT TVPE TO QUITW 2156 PRINT HIT RETURN TO ADD RECORD 2160 PRINT WIJH0SE RECORD DO VOU 2161 INPUT WISH TO SEE liirSRR 2165 IFRR THEN2310 2167 IFRR THEN2400 2168 IFRR DIR THENGOSUB4000 GOTO2160 217...

Page 100: ...i 94 NOTES i i L i rn v vv i S V i m r i fv w ir iiA V V wt r I T v v v r r V J v ri iO v...

Page 101: ...d 31 RENAME command 32 SCRATCH command 33 Chapter 10 INDEX Block availability map 22 Block distribution by track 54 BLOCK ALLOCATE command 51 BLOCK EXECUTE command 50 BLOCK READ command 49 BLOCK WRITE...

Page 102: ...maintenance commands Diskette level 23 File level 23 96 Disk operating system 15 18 22 25 47 59 69 70 71 72 77 Disk programming advanced 47 Disk utility command set 48 BLOCK READ 48 50 BLOCK WRITE 48...

Page 103: ...mance test 4040 8050 14 2040 3040 17 POKE command 14 17 Pointer block 26 PRGfile 36 61 Primary key file KEYOl 66 PRINT command 41 Program file 61 Program file format 61 Quickload feature 44 Quick refe...

Page 104: ...Disk utility commands 48 Error messages 81 Suppression of line feeds 41 98 Symbols DOS support 78 Tab write protect 13 Tape to disk 45 TEST DEMO diskettes 9 14 17 23 U1 command 52 U2 command 52 Unive...

Reviews: