background image

Содержание vic-1540

Страница 1: ...commodore WiC Ii USER S MANUAL SINGLE DRIVE FLOPPY piSK by commodore...

Страница 2: ...SINGLE DRIVE FLOPPY DISK USER S MANUAL p N154OOO18 OS commodore...

Страница 3: ...sponsibility however is assumed for inaccuracies The material in this manual is for information purposes only and is subject to change without notice Commodore Business Machines Inc September 1981 All...

Страница 4: ...pter 2 Preparing To Use Your Disk Drive 9 Connecting The Disk Drive To The Computer 9 Performing The Power On Test 10 Inserting The Diskette 1 Disk Drive Performance Test 12 Chapter 3 Learning How To...

Страница 5: ...30 Closing The Data Channel 30 PRINT 31 INPUT 32 GET 33 Moving a Tape Program to Disk 34 Chapter 5 Advanced Disk Programming 35 Commodore Disk Operating System DOS 35 Special OPEN and CLOSE Statements...

Страница 6: ...ram 57 Chapter 8 Error Messages Pattern Matching File Names 61 Requesting Error Messages 61 Summary of DOS Error Messages 61 Description of DOS Error Messages 62 Pattern Matching 66 Appendix 69 List o...

Страница 7: ...pecifications Model 1540 Single Drive Floppy Disk 6 3 Standard Jump Table 43 4 Block Distribution by Table 43 5 1540 BAM Format 44 6 1540 Directory Header 44 7 Directory Format 45 8 Sequential Format...

Страница 8: ...er by carefully and thoughtfully studying its contents you will gain the confidence necessary to progressively upgrade your programming skills and expertise This manual presents discussions descriptio...

Страница 9: ...1010 Doyle P O Box 3100 Menlo Park CA 94025 1973 A Guided Tour of Computer Programming in BASIC T Dwyer Houghton Mifflin Co 1973 Programing Time Shared Computer in BASIC Eugene H Barnet Wiley Intersc...

Страница 10: ...orkner Prentice Hall 1977 The Channel Data Book B Lewis 5960 Mandarin Ave Goleta CA 93017 1978 PET and the IEEE 488 Bus GPIP Osborne McGraw HW 630 Bancroft Way Berkeley CA 94710 Personal Computing on...

Страница 11: ...e disk drive contains two serial interface connectors Near the panel s lower edge is the power connector There is also a slow blow fuse Interior Configuration The interior of your floppy contains a di...

Страница 12: ...iVIC 1540 DRIVE INDICATER RED LED LIGHT ACTIVE FLASH ERROR POWER INDICATER GREEN LED LIGHT POWER ON Figl Front Panel POWER SWITCH SERIAL BUS FUSE HOLDER Fig 2 Back Panel...

Страница 13: ...ency Power MEDIA Diskettes 174848 bytes per diskette 168656 bytes per diskette 167132 bytes per diskette 65535 records per file 144 per diskette 17 to 21 256 35 683 664 blocks free microprocessor I O...

Страница 14: ...diskette on top of your computer or disk drive 4 Do not write on the plastic jacket with a lead pencil or ball point pen Use a felt tip pen or fill out the label before attaching it to the jacket 5 Do...

Страница 15: ...NOTES...

Страница 16: ...lied with your disk drive NOTE The disk drive should be the first peripheral attached to the computer if other devices are to be daisy chained Follow these steps to connect the disk drive to your comp...

Страница 17: ...he expansion module have the optional cartridge inserted before turning power on STEP 3 Turn power ON to the COMPUTER and verify that is working properly STEP 4 Apply power to the disk drive All two i...

Страница 18: ...ive door and make sure that no diskette is present in the drive STEP 2 STEP 3 STEP 4 STEP 5 If the preceeding conditions have been met you may apply power to the disk drive Insert the diskette into th...

Страница 19: ...must be followed by a carriage return press the RETURN key on your keyboard NOTE Commands must be entered exactly as shown DO NOT insert any spaces unless shown in the example If the error indicator...

Страница 20: ...for further use when the test program is completed and the performance test has been satisfied The computer will first format the diskette in the drive At the end of the operation the screen displays...

Страница 21: ...ER OFF STEPS Remove the diskettes and return them to their protective jackets The floppy has passed the Performance Test STEP 6 If any problems have been encountered during this phase of the test retu...

Страница 22: ...irst acquaint the user with those fundamental disk commands that perform disk maintenance and file manipulation and will then progressively advance toward an understanding of those BASIC commands used...

Страница 23: ...Location and Memory Required Track 18 Sector 0 128 bytes As changes occur to the BAM in DOS memory the BAM on disk will be updated to reflect these changes Updates to the BAM occur when a program is s...

Страница 24: ...hat the logical file was opened but had not been properly closed When this error appears such logical file must be properly closed by typing CLOSE 15 NEW Each time a diskette is placed in one of the d...

Страница 25: ...o ID specified to clear the disk directory and reinitialize the BAM deallocating all blocks on the diskette The time involved in reformatting without an ID is much less than formatting with an ID Exam...

Страница 26: ...igned each diskette The format of INITIALIZE command is PRINT 15 INITIALIZEdr Where dr drive number 0 0 may be ommitted Note You may abbreviate INITIALIZE to I Example 1 OPEN 15 8 15 PRINT 15 I0 Examp...

Страница 27: ...ly formatted disk has the correct ID and disk name by using one of the following methods to list the directory The directory display includes the following information Disk name Disk ID DOS version nu...

Страница 28: ...VALIDATE command traces through each block of data contained in all files on the diskette If this trace is successful a new BAM is generated in the disk memory and written to the diskette Any blocks...

Страница 29: ...nsfn or PRINT lfn Cddr dfn sdr sfn sdnsfn Where ddr is the destination drive 0 0 may be ommitted dfn is the destination file name This name must be a new name sdr is the source drive 0 0 may be omitte...

Страница 30: ...he letter R is a legal abbreviation for RENAME NOTE Close any open files before using the RENAME command since the disk will not execute this command on any active files SCRATCH The SCRATCH command er...

Страница 31: ...ase several files at one time when names have something in common refer to the rules in clapter 8 concerning pattern matching You may erase all files on a diskette using pattern matching as in the fol...

Страница 32: ...disk drive number 0 0 may be omitted 8 device number 8 for disk 2 for second cassette 4 for printer sa secondary address ft the file type It may be SEQ for sequential USR for user or PRG for program...

Страница 33: ...characters or less you wish to assign to the file to be transferred to the diskette Blanks are counted as characters dn is the device number and it must be 8 This following example illustrates creati...

Страница 34: ...erytime you use the SAVE command to place a file on a diskette If you do this you will always know whether or not the file was copied correctly LOAD Reading a Program from a Diskette A program stored...

Страница 35: ...ith the disk drive command and error channel OPEN This command sets up a correspondence between a logical file number and a file which exists on disk It also reserves the buffer space within the disk...

Страница 36: ...ng procedures are exe cuted You can also assign some of the OPEN parameters to a variable name as il lustrated in these examples Example 1 FL 0 FILEA SEQ READ OPEN 1 8 14 FL Example 2 FL 0 FILEA OPEN...

Страница 37: ...EN3 4 A channel is opened to the printer by mistake FILE OPEN ERROR An error message is displayed on READY the screen a Since there was an error all logical files in the computer are closed but the ch...

Страница 38: ...r 128 to 255 send CRLF A semicolon must be used as a terminator for each PRINT statement when using the logical file number 128 to 255 to avoid sending extraneous line feeds to the diskette It is impo...

Страница 39: ...logical file that has been OPENed for input The format for INPUT is INPUT 1 fn A or INPUT 1 fn A Where 1 fn file previously opened using secondary address 15 A astring variable which will contain the...

Страница 40: ...GET command is used to transfer individual bytes of information from an serial device such as the disk drive into computer memory GET is valid only when used in a program and only when referencing a...

Страница 41: ...read from the diskette to the computer s memory and printed It is assumed that the BASIC program was previously stored on the cassette Example LOAD DEMO PRESS PLAY ON TAPE OK SEARCHING FOR DEMO FOUND...

Страница 42: ...not available a NO CHANNEL error is generated The DOS also uses the channel structure to search the directory and to delete and copy files Three of the eight buffers are used by the DOS for the Block...

Страница 43: ...reserve a buffer for position dependent code as in the case of an execute command You can find the number of the allocated buffer by executing a GET state ment The byte transmitted is the buffer numb...

Страница 44: ...l The values used in conjunction with the memory commands exist in the VIC 1540 as hexidecimal values and must be transmitted as CHR n where n is the decimal equivalent of the desired hexidecimal valu...

Страница 45: ...ility command provides direct access to any block on a diskette in either disk drive Used in conjunction with other block commands a random access file system may be created through BASIC This command...

Страница 46: ...eside on disk and be loaded into disk drive memory and executed B E is really a B R with an addition The File Interface Controller begins execution of the contents after the block is read into a buffe...

Страница 47: ...rror If there are no blocks available that are greater in number than the one requested zeroes are displayed as track and sector parameters The format B A dr t s is illustrated in the following exampl...

Страница 48: ...S memory Special routines may be down loaded to the disk drive through this command and then executed using the MEMORY EXECUTE command or one of the USER U commands Up to 34 bytes may be deposited wit...

Страница 49: ...cimal 12672 USER This command provides a link to 6502 machine code according to a jump table pointed to by the special USER pointer Refer to Table 5 The second character in this command is used as an...

Страница 50: ...to 0506 jump to 0509 jump to 050C jump to S050F jump to FFFA power up vector U3 thru U9 commands are user defined The locations jumped to are located in the buffer areas of RAM and routines may be wri...

Страница 51: ...ks for tracks 1 35 1 available block 0 block not available each bit represents one block Table 6 Directory Header Track 18 Sector 0 BYTE 144 161 162 163 164 165 166 166 167 171 255 CONTENTS 160 50 65...

Страница 52: ...directory entry BYTE 0 1 2 3 18 19 20 21 22 25 26 27 28 29 CONTENTS 128 type DEFINITION File type OR ed with 80 to indicate properly closed file TYPES 0 DELeted 1 SEQential 2 PROGram 3 USER 4 RELativ...

Страница 53: ...k pointers enable the system to retrieve data from non continuous blocks Retrieving the first data block within a file triggers a search for the next data block which in turn utilizes block pointers t...

Страница 54: ...OINTERS TO LINK Nv TOGETHER ALL BLOCKS WITHIN A FILE SYNC 08 ID1 ID2 TRACK SECTOR CHECK SUM GAP1 SYNC 07 i I 254 BYTES OF DATA CHECK SUM GAP 2 Fig 5 VIC 1540 Format Expanded View of a Single Sector 47...

Страница 55: ...NOTES...

Страница 56: ...B must be read without doing any work In the sequential file no partial re write of the record can be made Only change which can be made to the sequential file is an addition of new record to the end...

Страница 57: ...PROGRAM An example of a simple program to create a sequential file is shown below Records consisting of string field and numeric field are written in and the con tents of the records is displayed at t...

Страница 58: ...ST FILE 204 REM 205 REM 206 PRINT 207 PRINT MREflD SEQ TEST FILES 208 PRINT 210 OPEN2 B 2 0 SEQ TEST FILE S R 215 GOSUB 1000 220 INPUTt2 fl I B I 224 RS ST 225 OOSUB 1000 230 PRINTfif I Ba 240 IFR S 6...

Страница 59: ...1886 REN 1818 INPUT 13 EN EM ET E 1828 IF EN 8 THEN RETURN 1838 PRINT iniflERROR ON DISK 1048 PRINT rEN EM ET ES r 1858 CL0SE2 1068 END 52...

Страница 60: ...to transfer the data in the random access file It can be illust rated as Fig 6 Channel 5 OPEN 5 8 15 PRINT 5 B W 3 0 6 4 Transfer the data from the buffer to the computer Channel 3 OPEN 4 8 3 7 PRINT...

Страница 61: ...r Logical File Number STEP 2 Move the buffer pointer PRINT 5 B P 3 120 L Pointer Position Channel Number of Setting of Block Pointer STEP 3 Place the data in the buffer PRINT 4 A CHR 44 I CHR 13 Logic...

Страница 62: ...ting of Block Pointer STEP 7 Take out the data from the buffer INPUT 4 A 1 Logical File Number of By Variables EXAMPLE OF USING RECORD NUMBER More practical program which uses variables will be as fol...

Страница 63: ...25 G0T03378 5360 IFF 580THENF1 580 F2 18 F3 31 5370 FT INT P F1 1 F2 1 F3 5380 FS F F1 FT F3 F2 FT F3 1 5390 RETURN Where CH Channel number FD Drive number FP Buffer pointer The line numbers 5270 to...

Страница 64: ...OF A RANDOM FILE PROGRAM A simple program has been made using method to create a random access file described above This program can be used for the preparation deletion and inquiry of an address list...

Страница 65: ...2 PRINT IIISII I I I V IB91B I I I l CREfiTE 2 DELETE 3 SEP RCH 0 ENH 64 PRINT 65 PRINT 66 INPUT 1 2 3 0 1UM O 68 IFO 0 THENCLOSE15 CLOSES CL0SE2 END 70 IFO 1 THEN104 72 IFO 3 THEN300 74 IFO O 2 THES5...

Страница 66: ...FI F O 1 THEN220 240 I F PR I NT WKECORD NO F DELETES 250 GOTO220 260 OPENS 8 5 SO INDEX 1 1 265 FOR I 1T0664 PR I NT 5 1 i I CHR 13 276 PR I NT lS M I W Si lJH IT IllSai I I I 275 NEXT CLOSES 280 GOT...

Страница 67: ...iCH FD FT FS 525Q GOSUB5270 5260 RETURN 5270 REM 5275 REM ERROR CHECK 527S REM 5280 INPUT l 5 EH EM ET ES 5296 IFEN 0THENRETURN 5360 PR I NT ERROR STflTUS EH EM ET ES 5310 INPUT CONTINUE f t IFV V TH...

Страница 68: ...and resets the device error indicator 10 OPEN 1 8 15 20INPUT l A B C D 30 PRINT A B C D where A error message number B error message C track D sector SUMMARY OF DOS ERROR MESSAGES 0 OK no error exist...

Страница 69: ...rectory full 73 Power up message or write attempt with DOS mismatch 74 Drive not ready DESCRIPTION OF DOS ERROR MESSAGES NOTE Error message numbers less than 20 should be ignored with the excep tion o...

Страница 70: ...DOS memory 26 WRITE PROTECT ON This message is generated when the controller has been requested to write a data block while the write protect switch is depressed Typically this is caused by using a d...

Страница 71: ...zable by the DOS 50 RECORD NOT PRESENT Result of disk reading past the last record through INPUT or GET commands This message will also occur after positioning to a record be yond end of file in a rel...

Страница 72: ...higher in number are in use 66 ILLEGAL TRACK AND SECTOR The DOS has attempted to access a track or sector which does not exist in the format being used This may indicate a problem reading the pointer...

Страница 73: ...is made to write upon a disk which has been formatted in a non compatible format This message may also appear after power up 74 DRIVE NOT READY An attempt has been made to access the VIC 1540 Single D...

Страница 74: ...FILE 32 or POKEFILES or any other files starting with P and having FIL in positions 5 7 SCRATCH with pattern matching should be used carefully since multiple files will be scratched LOAD will load the...

Страница 75: ...68...

Страница 76: ...ghtly and the used blocks are displayed dark Because of the formatting of VIC 1540 sector 19 on is not persent on tracks 18 to 24 The VIEW BAM program will show these blocks as allocated DISPLAY T S w...

Страница 77: ...CLOSED END 2010 GET T IF T THEN 2000 2020 RETURN 4000 REM DISK COMMflND 4010 C PRINTI1 M 4011 GETB IFB IM1 THEN4011 4012 PRINTB IF B CHR 13 THEN 4020 4013 C C B GOTO 4011 4020 PRINT 2 C 5008 PRINT 51...

Страница 78: ...MUWWiaflNOTHER DISKETTE NIIIG R 410 IFfl V THENRUN 420 IFWCV THENEND 430 PRINTLEFT V V LEFT X X II 440 RETURN 456 GET 2 SC SC RSC RIGHT CHR 0 SC 1 460 TS TS SC 470 GET 2 fi lFfl THENfl CHR 0 480 SB 0...

Страница 79: ...FER 310 REM 320 iNPurfcirrRRCK sector11 t s 330 IF T 0 OR T 35 THEN PRINT 15 lI Di CL0SE2 CL0SE4 CL0SE15 PRINTllEND EN 340 IF JJ S THEN PRINT WTRRCKIIT SECTOR1 11 341 IF JJ P THEN PRINT 4 PRINTS TRRCK...

Страница 80: ...THEH590 600 IF Z 11 THEN T NB 1 S NB 2 GOTO330 610 IF Z N THEN 320 620 GOTO 590 630 REM 649 REM SUBROUTINES 650 REM 660 REM ERROR ROUTINE 670 REM 630 INPUT 15 EN EM ET ES IF EN 0 THEN RETURN 690 PRIN...

Страница 81: ...RINT TRflCK liHI T SECTOR IHm S Tl 140 INPUT 15 EN EM ES ET 150 IF EN 0THEN35 160 T J T S J S J J 1 165 PRINT MWBflD BLOCK III T S S 170 G0T035 200 PRINT 15 rD 210 GOSUB900 212 CL0SE2 215 IF 0THENPRIN...

Страница 82: ...1350 1360 1370 PRINT MDRIVE PfiSS 1380 PRINT MECHRNICRL TESTW 1390 TT 21 1400 OPEN 2 3 2 0 TEST FILE S W 1410 CC OPEN WRITE FILE GOSUB 1840 1450 CH 2 CC MRITE DRTfl GOSUB 1930 1430 CC CLOSE CC GOSUB...

Страница 83: ...N 1810 GOTO 1760 1820 1830 1840 PRINT CC 1850 INPUT 1 EN EM ET ES I860 PRINTTRB 12 ai EN EM ET ES SM 1870 IF EN 2 THEN RETURN 1880 PR1NT M UNIT IS FRILING 1890 PRINT M PERFORMflNCE TEST 1900 TM TI OOS...

Страница 84: ...6 Correct TYPE OPEN1 8 15 I0 5340 IFF 357ANDF 472 5360 IFF 579THENF1 579 25to30 0tol7 18 472 579 31to35 0tol6 17 580 664 These programs require an expander RAM 410 PRINT 15 M R CHR 0 CHR 5 CAUTION At...

Страница 85: ......

Страница 86: ......

Отзывы: