background image

Summary of Contents for 1551

Page 1: ......

Page 2: ......

Page 3: ...COMMODORE 1551 DISK DRIVE USERJS GUIDE A Friendly Introduction to Your 1551 Diek Drive ...

Page 4: ...d and is believed to be entirely reliable No responsibility however is assumed for inaccuracies The material in this manual is for information purposes only and may be changed without notice Commodore Electronics Ltd October 1984 All rights reserved ...

Page 5: ...sing packaged programs 10 How to prepare a new diskette 12 Organizing a diskette library 12 Backups 13 What is a directory 13 Viewing a directory 14 What a directory shows 14 CHAPTER 3 OPERATION 16 The command channel 16 Error checking 17 Error check subroutine 17 BASIC housekeeping hints 17 More about directories 18 Selective directories 19 Printing a directory 19 Pattern matching and wild cards ...

Page 6: ...ative files Record command 46 Completing relative file creation 48 Expanding a relative file 49 Writing relative file data 50 Designing a relative record 50 Writing the record 51 Reading a relative record 53 The value of index files advanced users 54 CHAPTER 6 DIRECT ACCESS COMMANDS 55 A tool for advanced users 55 Diskette organization 55 Opening a data channel for direct access 55 Block read 56 B...

Page 7: ... number 71 B DOS error messages and likely causes 73 C Diskette formats 77 D Disk command quick reference 82 E Test Demo diskette 83 F Specifications of the 1551 disk drive 86 LIST OF FIGURES Figure 1 Front panel Figure 2 Back panel Figure 3 Single and twin drive hookup Figure 4 Position for diskette insertion ...

Page 8: ......

Page 9: ...ut affecting the rest of the file Overall using a disk drive makes for easier and more powerful computing FEATURES OF THE 1551 The 1551 is one of the most affordable disk drives on the market Compared to competitors it has high capacity and even higher intelligence It is one of the most co t effective disk drives available Most home and personal computers that use a disk take at least 10K of RAM m...

Page 10: ...mputer at once as long as each peripheral is assigned a different device number When there is contention with duplicate device numbers the 1551 has priority over the 1541 HOW TO USE THIS BOOK This book is divided into two main parts The first part gives you the information you need to use the 1551 effectively even if you know little or nothing about programming This part of the book tells you how ...

Page 11: ... drive is unpack it Inside the carton in which you found this manual there should also be a 1551 disk drive a gray power r l5 commodore 111I1I1I1I1II1II1I1II11I1I1I15 _Jl I I I l I DOOR LEVER DRIVE INDICATER RED LED LIGHT FLASH POWER INDICATER GREEN LED LIGHT POWER ON Figure 1 Front Panel 3 1 ACT ERR IVE OR ...

Page 12: ...ES The power cable plugs into the back of the disk drive at one end and into a grounded 3 prong outlet at the other end It will only go in one way Before you plug it in though make sure that your entire computer system is turned off The disk drive s on off switch is in the back on the left side see Figure 2 It is off when the portion marked off is pushed inward Leave your whole system off until ev...

Page 13: ... including the computer the disk drive will go through a self check for a second or so to be sure it is working correctly After the drive is satisfied with its own health it will flash the red light below the drive door once and the green power on light to the left of the drive door will glow continuously At the same time the computcr will be going through a similar self test and displaying its he...

Page 14: ... If unplugging the interface cable made a difference check the cable for proper connection The principle behind unplugging the interface cable is divide and conquer The drive can do its power on test even when not connected to a computer If it succeeds that way then the problem is probably in the cable or the rest of the system not the 1551 Programs won t load and computer says DEVICE NOT PRESENT ...

Page 15: ...lign your disk drive Your 1551 should serve you well for years to come but there are a few things you can do to avoid costly maintenance 1 Keep the drive well ventilated Like a refrigerator it needs a few inches of air circulation on all sides to work properly If heat can t be avoided any other way you may cool the drive by placing a small filtered fan on the drive so its air blows into the coolin...

Page 16: ...T oil and the write protect sensor may need to be dusted to be sure its optical sensor has a clear view Since most of these chores require special materials or parts it is best to leave the work to an authorized Commodore service center If you wish to do the work yourself ask your dealer to order the 1551 maintenance guide for you part number 990445 but be aware that home repair of the 1551 will v...

Page 17: ...piece of tape This notch is called the write protect notch When it is covered with the opaque tape packed with blank diskettes the disk drive cannot change the contents of that diskette Never remove the tape on the Test Demo diskette At least two other parts of the diskette are worth mentioning The hub and the access slot The hole in the center is called the hub A cone shaped spindle fills it when...

Page 18: ...kits intended to double your diskette s capacity by cutting an extra write protect notch into a diskette it is best not to use the other side of the diskette on the 1551 drive even if your diskette is labeled double sided Doing so will cause added wear to your diskettes and drive and may cost you an important program some day 4 When buying diskettes you may use any good quality 5 4 inch diskette 5...

Page 19: ... which are covered in more detail later At this point however try this command if a program doesn t load properly using the other command IMPORTANT NOTE Throughout the rest of this manual when the format for a command is given anything that is capitalized must be included as is when you type in the command Anything in lower case is more or less a definition of what belongs there For instance in th...

Page 20: ...aracter string variable The chattering or thumping noise you hear just after the HEADER command begins is entirely normal The drive must be sure it is at track I which it assures by stepping outward 4S times on a 35 track diskette The noise you hear is the head assembly hitting the track 1 bumper after its inevitable arrival After you have once formatted a particular diskette you can re format it ...

Page 21: ...pendix E How to Rotate Backups Once you begin to accumulate backups you ll want to recycle older ones One good method is to date each backup Then retain all backups until the current project is finished When you are sure the last backup is correct make another backup of it to file and move all older backups to a box of diskettes that may be reused One other popular approach suited to projects that...

Page 22: ...WS Let s look at a typical directory on the Test Demo diskette packed with your 1551 disk drive READY 0 14 HOW TO USE PRG 12 HOW PART 2 PRG 12 HOW PART 3 PRG 4 VIC 20 WEDGE PRG C S4 WEDGE PRG 4 DOS l PRG 9 PRINTER TEST PRG IMPORT ANT NOTE 4 DISK ADDR CHAt iE PRG Your Test Demo diskette S V lEW BAM PRG may contain additional 4 CHECK DISK PRG programs Commodore may update the diskette 14 DISPL AY T ...

Page 23: ...t end of each line is the size of that line s file in blocks or sectors of 256 characters Four blocks are equivalent to IK 1024 characters of RAM read write memory inside the computer The middle of each directory line contains the name of the fi Ie enclosed in quotation marks All characters between the quote marks are part of the name and must be included when loading or opening that file The righ...

Page 24: ...f 15 which is the address of the command channel The middle number is the primary address better known as the device number and is normally 8 unless you change it according to instructions in Appendix A Once the command channel has been opened use the PRINT command to send information to thc disk drive and INPUT command to receive information back from the disk drive Once you have finished using t...

Page 25: ...ated automatically by BASIC Two error numbers are harmless 0 means everything is OK and I tells how many files were erased by a SCRATCH command described later in this chapter If the error status is anything else line 60000 prints the error message and halts the program After you have repaired the damage you may then continue the program with BASIC s CONT command Because this is a subroutine you a...

Page 26: ...smatch between the DOS used to format your diskette and the DOS in your drive HINT 4 To reset drive type OPEN15 S 15 UJ Then wait until the drive activity LED is off and motor goes off then type CLOSE15 This also applies to sending a UI or a UI MORE ABOUT DIRECTORIES We discussed the basic elements of directories in the last chapter Here we provide more detailed information that you can use to man...

Page 27: ...er R the asterisk is explained in the section Pattern matching and wild cards The command LOAD 0 R displays all relative files PRINTING A DIRECTORY To get a printout of a directory type the following LOAD 8 OPEN4 4 CMD4 LlST PRINT 4 CLOSE4 Type it in immediate mode to avoid disturbing the directory This command assumes a printer device of 4 All other options such as differing device numbers and se...

Page 28: ...ed later SPLAT F ILl S One indicator you may occasionally notice on a directory line after you begin saving programs and files is an asterisk appearing just before the file type of a file that is 0 blocks long This indicates the file was not properly closed after it was created and that it should not be relied upon These splat files as they are called in England will normally need to be erased fro...

Page 29: ... MON TOR SAVE S drive file name device starting address ending address I where drive is the drive number 0 on the 551 file name is any valid file name up to 14 characters long leaving 2 for the drive number and colon device is a two digit device number normally 08 on the 1551 the leading 0 is required and the addresses to be saved are given in Hexadecimal base 16 but without a leading dollar sign ...

Page 30: ...sn t occupy enough blocks to match the copy in memory VERIFY This command makes a byte by byte comparison of the program currently in mem ory against a program on disk This comparison includes Iine links which may be different for different types of memory configurations What this means is that a program saved to disk on a Commodore 64 and re Ioaded into a Plus4 wouldn t verify properly because th...

Page 31: ...e alternate command is PRINT 15 COPY new file name old file name or abbreviated to PRINT IS C new file name old file name To copy a file on a second disk drive with a device number of 9 we would use COPY old file name TO new file name U9 NOTE If you want to copy a file from one diskette to another you cannot use the COpy command Instead use the copy program on the Test Demo diskette see Appendix E...

Page 32: ...ernate command is PRINT 15 SCRATCH filename or abbreviated to PRINT 15 S filename file name can be any file name or combination of characters and wild card characters If you use the direct command you will be asked as a precaution ARE YOU SURE If you ARE sure simply press Y and RETURN If not press RETURN alone or type any other answer and the command will be cancelled The number of files that were...

Page 33: ...recover your file for you It will help if you can remember what kind of file it was you scratched program sequential etc since that information cannot be directly recovered from what is left of the file NOTE Check Appendix E There may be an Unscratch program on your Test Demo diskette More about Splat Files One other warning never SCRATCH a splat file These are files that show up in a directory li...

Page 34: ...ks are done see Chapter 9 and Appendices D and E RENAME The RENAME command allows you to alter the name of a file in the diskette directory Since only the directory is affected RENAME works very ljuickly If you try to RENAME a file by using a file name already in the directory the computer will respond with a FILE EXISTS error FORMAT FOR RENAME COMMAND RENAME old name TO new name The alternate com...

Page 35: ...ate a file named MOVIES with an extra quotation mark at the front of the file name you can rename it to MOVIES by using the Chr O equivalent of a quotation mark in the RENAME command Example RENAME CHR 34 MOVIES TO MOVIES Alternate example PRINT 15 RO MOVIES CHR 34 MOVIES The CHR 34 forces a quotation mark into the command string without upsetting BASIC The procedure for a file name that includes ...

Page 36: ...ate their sectors in a way COLLECT can recognize Thus collecting such a diskette may result in un allocating all direct access files with loss of all their contents when other files are added Unless specifically instructed otherwise never collect a diskette containing direct access files Note these are not the same as the relative files described in Chapter 6 COLLECT may be used on relative files ...

Page 37: ...15 Idrive PRINT 15 10 where the command channel is assumed to be opened by file 15 and drive is 0 on the 1551 One use for INITIALIZE is to keep a cleaning diskette spinning if you choose to use one under normal conditions a cleaning diskette is not necessary Ifyou are using such a kit the following short program will keep the diskette spinning long enough for your need about 20 seconds 10 OPENI5 8...

Page 38: ......

Page 39: ... buffer onto the magnetic media Once in the disk drive program files sequential data files and user files all work sequentially Even the directory acts like a sequential file To use sequential files properly we will learn some more Basic words in the next few pages Then we ll put them together in a simple but useful program Note Besides sequential data files two other file types are recorded seque...

Page 40: ...e flexibility of the Open statement it is possible for a single program statement to contact anyone of these devices or even others depending on the value of a single character in the command Often an Open statement is the only difference between a program that uses a DATASSETTE and one using the 1551 If the character is kept in a variable the device used can even change each time that part of the...

Page 41: ...0 on the 1551 Do not omit it or you will only be able to use two channels at the same time instead of the normal maximum of three If any pre existing file of the same name is to be replaced precede the drive number with the at sign to request Open with replace file name is the file name maximum length 16 characters Pattern matching characters are allowed in the name when accessing existing files b...

Page 42: ... name does have to match However it is possible to usc an abbreviation form of the file name if there are no other files that would have the same abbreviation OPEN 10 8 6 O PH S R If we have too many phone numbers they might not fit in one file In that case we might use several similar file names and let a program choose the correct file 100 INPUT WHICH PHONE FILE l 3 PH 110 IF PH I AND PH 2 AND P...

Page 43: ...SCRATCH TEMP WRITING FILE DATA USING PRINT After a sequential file has been opened to write with a type and direction of S W we use the Print command to send data to it for storage on diskette If you are familiar with Basic s Print statement you will lind Print works exactly the same way except that the list of items following the command word is sent to a particular tile instead of automatically ...

Page 44: ...be confused such as a string variable immediately following a numeric variable Note Do not leave a space between PRINT and and do not abbreviate the command as 1 The correct abbreviation for Print is pRo EXAMPLES To record a few grades for John Paul Jones using a sequential disk file I previously opened for writing we could use 200 FOR CLASS 1 TO COURSES 210 PRINT l GRADE CLASS 220 NEXT CLASS 320 ...

Page 45: ...imply be lost if the computer system were turned off Similarly there are diskette housekeeping matters such as updating the BAM Block Availability Map of sectors used by the current file which are not performed during the ordinary course of writing a Ille This is the reason for having a Close statement When we know we are done with a Ille the Close statement will write the rest of the data buffer ...

Page 46: ...put except that the list of items following the command word comes from a particular file instead of the keyboard Both statements are subject to the same limitations halting input after a comma or colon not accepting data items too large to fit in Basic s Input buffer and not accepting non numeric data into a numeric variable FORMAT FOR THE INPUT STATEMENT PRINT file variable list where file is th...

Page 47: ...ta element string or number being read from a disk file into an Input statement contains more than 87 characters Basic will halt with a STRING TOO LONG ERROR To prevent this error be sure to limit each string to under 88 characters and separate all file data items with carriage returns See the next section for a cure once the error has occurred FILE DATA ERRORS The other error message FILE DATA ER...

Page 48: ... did earlier with CHR 13 20 QT CHR 34 400 PRINT 5 QT NAME In each case the added quotation mark will be stripped out of the data by the Input or Input statement but the comma or colon will remain safely part of the data NUMERIC DATA STORAGE ON DISKETTE Inside the computer the space occupied by a numeric variable depends only on its type Simple numeric variables use 7 bytes character locations of m...

Page 49: ...MENT GET file variable list where file is the same file number given in the desired file s current Open statement and variable list is one or more valid Basic variable names If more than one data element is to be input by a particular Get statement each variable name must be separated from others by a comma In practice you will almost never see a Get or Get statement containing more than one varia...

Page 50: ...OR ST SU Copying ST into SU is often an unneccessary precaution but must be done if any other file handling statement appears between the one which read from the file and the one that loops back to read again For example it would be required if line 520 was changed to 520 PRINT 1 S Otherwise the file status checked in line 530 would be that of the write file not the read file POSSIBLE VALUES OF TH...

Page 51: ...60 PRINT 370 OPEN 2 8 2 O SEQ FILE S R 380 GOSUB 500 390INPUT 2 A B 400 RS ST 4IO GOSUB 500 420 PRINT A B 430 IF RS 0 THEN 390 440 IF RS 64 THEN PRINT STATUS RS 450 CLOSE 2 460 END 480 REM ERROR CHECK SIR 500INPUT 15 EN EM ET ES 5IO IF EN O THEN PRINT EN EM ET ES STOP 520 RETURN 43 Make a carriage return variable Open demo file with replace Check for disk errors Accept a string number from keyboar...

Page 52: ...ite the file matched up properly with those which read it back into the computer But in order for relative access to work we need a more structured and predictable environment for our data The structure we will use is similar to that used in the traditional filing cabinet In a traditional office all customer records might be kept in a single file cabinet Within this file each customer has a person...

Page 53: ...rdinal position within the file The only limit that will concern you is that each record must be the same size and the record length you choose must be between 2 and 254 characters Naturally the entire file also has to fit on your diskette too which means that the more records you need the shorter each must be CREATING A RELATIVE FILE When a relative file is to be used for the first time its Open ...

Page 54: ...s not quite ready for use Both to save time when using the file later and to assure that the file will work reliably it is necessary to create several records before closing the file for the first time At a minimum enough records to fill more than 2 disk sectors 512 bytes should be written In practice most programs go ahead and create as many records as the program is eventually expected to use Th...

Page 55: ...ritten with the Commodore Assembler the low part of a two byte number is indicated by preceding its label with the less than character Similarly the high part of the number is indicated by greater than SAFETY NOTE GIVE EACH RECORD COMMAND TWICE To avoid the remote possibility of corrupting relative file data it is necessary to give Record commands twice once before a record is read or written and ...

Page 56: ...offset is as above If you see a Record command written in Basic 4 form in a program you want to use simply convert it into the usual form for both Basic 2 and 3 5 described in this section COMPLETING RELATIVE FILE CREATION Now that we have learned how to use both the Open and Record commands we are almost ready to properly create a relative file The only additional fact we need to know is that CHR...

Page 57: ...ile up to the maximum record number you selected in line 1390 This is normal and only needs to be done once During the process you may hear the drive motor turning and an occasional slight click as the head steps from track to track everything is probably just fine Second line 60000 above is different from the equivalent line in the error check subroutine given earlier Here disk error number 50 is...

Page 58: ...n a carriage return The 1551 is smart enough to recognize the end of a relative record even without a final carriage return Though the saving of a single character isn t much when multiplied by the number of records on a diskette the savings could be significant Since each relative record must be written by a single Print statement the recom mended approach is to build a copy of the current record...

Page 59: ...0 THEN 140 160INPUrSTREET SA 170 IF LEN SA 30 THEN 160 180 INPUT CITY STATE CS 190 IF LEN CS 25 THEN ISO 200 INPUT ZIP CODE ZP 210 IF LEN ZP 10 THEN 200 220 DA NA CR SA CR CS CR ZP 230 IFLEN DA 88 THEN 260 240 PRINT RECORD TOO LONG 250 GOTOl40 260 RH INT RE 256 270 RL RE 256 RH 280 PRINT 15 P CHR 96 3 CHR RL CHR RH CHR I 290 IFDS 50THENPRINT 3 CHR 255 GOSUB 1000 GOT0280 300 GOSUBIOOO 310 PRINT 3 D...

Page 60: ...UBlOOO CLOSE3 CLOSEIS END 1000 IFDS 20 THEN RETURN 1010 PRINT ERROR DS CLOSE3 CLOSEIS END READY Select record number Open command channel Open the relative file myrelfile record length is 88 27 shifted space characters Enter fields Check length of each padding with shifted spaces to pre set size Build output data string Calculate record number Position to record number reo If record not present th...

Page 61: ... read back the variable fields created above from record number RE in file and channel 3 10 OPENI5 8 15 20 OPEN3 8 3 O MYRELFILE L CHR 88 30 INPUT ENTER RECORD NUMBER RE 40 RH INT RE 256 50 RL RE 256 RH 60 PRINT 15 P CHR 96 3 CHR RL CHR RH CHR 1 70 GOSUBlOOO 80 INPUT 3 NA SA CS ZP 90 GOSUB1000 100 PRINT 15 P CHR 96 3 CHR RL CHR RH CHR I 110 GOSUB 1000 120 PRINTNA PRINTSA 130 PRINTCS PRINTZP 140 CL...

Page 62: ...nd Error checking subroutine THE VALUE OF INDEX FILES ADVANCED USERS In the last two chapters we have learned how to use sequential and relative files separately But they are often used together with thc sequential file used to keep brief records of which name in thc rclative file is stored in each record number That way the contents of the sequential fi Ic can be read into a string array and sort...

Page 63: ... divided into tracks which are laid out as concentric circles on the surface of the diskette There are 35 different tracks starting with track I at the outside of the diskette to track 35 at the center Track 18 is used for the directory and the DOS fills up the diskette from the center outward alternately in both directions Each track is subdivided into sectors also called blocks Because there is ...

Page 64: ...EN 5 8 5 Or we can make the ehoice ourselves OPEN 4 8 4 2 BLOCK READ The purpose of a Block Read is to load the contents of a specified sector into a file buffer Although the Block Read command B R is still part of the DOS command set it is nearly always replaced by thc UI command See chapter 9 FORMAT FOR THE BLOCK READ COMMAND PRINT 15 Ul channel drive track sector whcre channel is the channel nu...

Page 65: ...uter memory beginning at the address set by variable MB in line 160 and may be examined and altered there This is the basis for programs like DlSPLAYT S on the Test Demo diskette BLOCK WRITE The purpose of a Block Write is to save the contents of a file buffer into a specified sector It is thus the reverse of the Block Read command Although the Block Write command B W is still part of the DOS comm...

Page 66: ...ock Write commands are nearly always replaced by the UI and U2 commands respectively the original command can still be used as long as you fully understand their effects Unlike UI and U2 B R and B W allow you to read or write less than a full sector In the case of B R the first byte of the selected sector is used to set the buffer pointer see next section and determines how many bytes of that sect...

Page 67: ...art of the data 2 Similarly in a true Block Write when the buffer is written hack to diskette the first byte written is the current value of the buffer pointer and only that many bytes are written into the specified sector It cannot be used to rewrite an entire sector onto diskette unchanged because the first data byte is overwritten by the buffer pointer THE BUFFER POINTER The buffer pointer poin...

Page 68: ... 6 to lock Point to Byte 2 again Overwrite it in buffer Rewrite buffer to diskette Tidy up after After the above program is run the first file on that diskette can no longer be erased If you later need to erase that file re run the same program but substitute the revised line 160 below to unlock the file again 160 A ASC A AND 191 Turn off bit 6 to unlock ALLOCATING BLOCKS Once you have written som...

Page 69: ...EM ET ES 160 IF EN 0 THEN 210 170 IF EN 65 THEN PRINT EN EM ET ES STOP 180 IF ET 0 THEN PRINT DISK FULL STOP 190 IF ET 18 THEN ET 19 ES 0 200T ET S ES GOTO 140 210 PRINT 15 U2 5 0 T S 220 PRINT STORED AT T S 230 CLOSE 5 CLOSE 15 240 END FREEING BLOCKS Open command channel direct access Write a message to buffer Start at first track sector Try allocating it See if it worked If so we re almost done ...

Page 70: ...his chapter it is possible to develop a file handling program that uses random files What you need to know now is how to kecp track of which blocks on the disk such a file has used Even though you know a sector has not been allocated by your random file you must also be sure it wasn t allocated by another unrelated file on the diskette The most common way of recording which sectors have been used ...

Page 71: ...in control Do not practice these commands on any important diskette Rather make a spare copy and work with that Knowing how to program a 6502 in machine language will help greatly and you will also need a good memory map of the 1551 A brief 1551 map appears below Location 0000 0001 0002 00FF OIOO OIFF 0200 02FF 0300 06FF 0700 07FF 4000 4007 Cooo FFE5 FFE6 FFFF 1551 MEMORY MAP Purpose 8 bit port 65...

Page 72: ... be read in from 1 255 Otherwise I character will be read If desired a colon may follow M R inside the quotation marks ALTERNATE FORMAT PRINT 15 M R CHR address CHR address CHR of bytes The next byte read using the Get statement through channel 15 the error channel will be from that address in the disk controller s memory and successive bytes will be from successive memory locations Any Input from...

Page 73: ...nter number of bytes wanted unless done or way out of line Enter starting address Convert it into disk form Actual Memory Read Loop til have all the data printing it as we go Forever The Memory Write command is the equivalent of the Basic Poke command but has its effect in disk memory instead of within the computer M W allows you to write up to 34 bytes at a time into disk memory The Memory Execut...

Page 74: ...thump the drive back to track I Bit 6 if set means no seeks In that case the drive won t attempt to read the half track above and below the assigned track to see if it can read the data that way The bottom 6 bits are the count of how many times the disk will try to read each sector before and after trying seeks and bumps before giving up Since 31 is the largest number that can be expressed in 6 bi...

Page 75: ...om the first location within the buffer until a ReTurn from Subroutine RTS instruction ends the command FORMAT FOR THE BLOCK EXECUTE COMMAND PRINT 15 B E channel drive track sector where channel is the channel number specified when the file into which the block will be loaded was opened drive is the drive number always 0 on the 1541 and track and sector arc respectively the track and sector number...

Page 76: ...ed off and on again User Command ul or ua u2 or ub u3 or uc u4 or ud uS or ue u6 or uf u7 or ug u8 or uh u9 or ui u or uj Function block read replacement block write replacement jump to 0500 jump to 0503 jump to 0506 jump to 0509 jump to 050c jump to 050f jump to fffa reset tables power up vector By loading these memory locations with another machine language JMP command such as JMP 0520 you can c...

Page 77: ... two bytes of the file must contain the low and high addresses respectively The third byte is the amount of characters to follow In addition a trailing checksum byte must be included The load address is the starting address FORMAT FOR THE UTILITY LOADER COMMAND PRINT 0 filename 69 ...

Page 78: ...LOX JSR JSR BEQ JSR 1MP LDA JSR JSR RTS BYT DISK RELATED KERNAL SUBROUTINES Address Function FFBA SET LOGICAL FIRST SECOND ADDRESSES FFBD SET LENGTH ADDRESS OF FILENAME FFCO OPEN LOGICAL FILE FFC3 CLOSE LOGICAL FILE FFC6 SELECT CHANNEL FOR INPUT FFC9 SELECT CHANNEL FOR OUTPUT FFCC CLEAR ALL CHANNELS RESTORE DEFAULT 110 FFCF GET BYTE FROM CURRENT INPUT DEVICE FFD2 OUTPlJT BYTE TO CURRENT OUTPUT DEV...

Page 79: ...S n Wherc n 8 or 9 EXAMPLE Here is a program that sets any device number 10 INPUT NEW DEVICE NUMBER DV 20 IF NOT DV 8 or DV 9 THEN 10 30 OPEN 15 8 15 R DV CLOSE 15 If you send only the sign the device number will toggle bctwccn 8 and 9 Note If you will bc using two disk drives and want to temporarily change the device number of onc you will need to run the abovc program with the disk drive whose d...

Page 80: ...ogether 4 Carefully turn drive right side up and remove case top 5 Remove 2 screws on side of metal housing covering the main circuit board 6 Remove housing 7 Locate the device number jumper It will be a small round silvery spot solder pads on the main circuit board 8 Make the cut by completing the cut already nearly separating the two halves of the jumper 9 Replace the metal housing and its 2 scr...

Page 81: ...ther error message numbers less than 20 ever appear they may be ignored All true errors have numbers of 20 or more 20 READ ERROR block header not found The disk controller is unable to locate the header of the requested data block Caused by an illegal block or a header that has been destroyed Usually unrecoverable 21 READ ERROR no sync character The disk controller is unable to detect a sync mark ...

Page 82: ...rable 28 WRITE ERROR long data block The controller attempts to detect thc sync mark of the next header after writing a data block If the sync mark does not appear on time this error message is generated It is caused by a bad diskette format the data extends into the next block or by a hardware failure 29 DISK ID MISMATCH The disk controller has been requested to access a di kette which has not be...

Page 83: ... relative record To avoid this error create the last record number that will be needed as you first create the file If the file is unavoidably too large for the diskette either split it into two files on two diskettes or use abbreviations in the data to allow shorter records 60 WRITE FILE OPEN A write file that has not been closed is being re opened for reading This file must be immediately rescue...

Page 84: ... on the diskette does not match the copy in disk memory To correct Initialize the diskette 72 DISK FULL Either the diskette or its directory is full DISK FULL is sent when 2 blocks are still available allowing the current file to be closed If you get this message and the directory shows any blocks left you have too many separate files in your directory and will need to combine some delete any that...

Page 85: ...APPENDIX C DISKETTE FORMATS Expanded View of a Single Sector 77 NOTE Not to scale ...

Page 86: ...ecksum of BYTEO BYTEI andDATA Variable gap of GCR O This gap is variable depending on the speed of the disk during format GAP 2 will be constant for all sectors except for the tail gap the gap between I st and the last sectors 1551 Format Expanded View of a Single Sector 1551 BLOCK DISTRIBUTION BY TRACK Track number Range of Sectors Total of Sectors I to 17 18 to 24 25 to 30 31 to 35 BYTE CONTENTS...

Page 87: ...next block in program file I 2 3 Load address of the program 4 255 Next 252 bytes of program information stored as in computer memory with key words tokenized REMAINING FULL SECTORS 0 1 Track and sector of next block in program file I 2 255 Next 254 bytes of program info stored as in computer memory with key words tokenized FINAL SECTOR 0 1 Null 00 followed by number of valid data bytes in sector ...

Page 88: ...n FF all binary ones in the first byte followed by 00 binary all zeros to the end of the record Partially filled records are padded with nulls 00 SIDE SECTOR BLOCK 0 1 Track and sector of next side sector block 2 Side sector number 0 5 3 Record length 4 5 Track and sector of first side sector number 0 6 7 Track and sector of second side sector number 1 8 9 Track and sector of third side sector num...

Page 89: ...NITION 0 128 File type OR ed with 80 to indicate properly closed file if OR ed with CO instead file is locked type TYPES 0 DELeted I SEQuential 2 PROGram 3 USER 4 RELative 1 2 Track and sector of first data block 3 18 File name padded with shifted spaces 19 20 Relative file only track and sector of first side sector block 21 Relative file only Record length 22 25 Unused 26 27 Track and sector of r...

Page 90: ...ile device channel command string PRINT file data list P CHR channel CHR record CHR record CHR offset DIRECT ACCESS COMMANDS BLOCK ALLOCATE BLOCK EXECUTE BLOCK FREE BUFFER POINTER BLOCK READ BLOCK WRITE MEMORY EXECUTE MEMORY READ MEMORY WRITE USER CHANGE RETRY CHANGE SECTOR INTERLEAVE UTILITY LOADER B A O track seetor B E channel O track sector B F O track sector B P channel byte UI channel O trac...

Page 91: ...aded directly but is loaded instead from the program C 64 WEDGE Its load address is CC00 hexadecimal PRINTER TEST The PRINTER TEST prints a listing of characters in a form that makes it easy to check the mechanical and electronic capabilities of the printer DISK ADDR CHANGE Use this program to change the device number of the disk drive It is a soft change when the system is turned off the disk dri...

Page 92: ...d the diskette to be copied in and out of the drive at the appropriate times Loading and running them incorrectly may damage a diskette PRINT xx UTIL These three programs are actually entitled PRINT 64 UTlL PRINT 4 and PRINT CI6 UTlL They provide two functions a printout of any Text Mode screen display and a listing of the contents of all scaler non array variables in a Basic pro gram to screen or...

Page 93: ... CHANGE Allows you to rename a diskette without losing the data currently stored in the diskette IMPORTANT NOTE Your Test Demo diskette may contain additional programs Commodore may update the diskette from time to time ALL ADDITIONS DELETIONS OR MODIFICATIONS TO THE PRO GRAMS LISTED IN THIS APPENDIX WILL BE NOTED IN THE HOW TO USE PROGRAMS ON YOUR TESTIDEMO DISKETTE 85 ...

Page 94: ...diskette 65535 144 35 17 21 683 total 664 free for data 256 INTEGRATED CIRCUIT CHIPS USED 6510T 6523A 23128 4016 Gate Array PHYSICAL DIMENSIONS Height Width Depth Weight ELECTRICAL REQUIREMENTS microprocessor 110 1 0 16K bytes ROM 2K bytes RAM Controller circuit 97 mm 200mm 374mm 10 5 kg Three wire grounded detachable power cable Voltage U S 100 120 VAC Export Frequency U S Export Power used MEDIA...

Page 95: ......

Page 96: ......

Page 97: ......

Page 98: ......

Page 99: ......

Page 100: ......

Reviews: