LOAD"*",8 ; load first/recenty accessed file LOAD"FILENAME",8 ; load specified file LOAD"$",8 ; load and view the directory LOAD"$0:FILE*",8 ; load and view specific names in the directory SAVE"FILENAME",8 ; save a file to disk SAVE"@0:FILENAME",8 ; save a file to disk and delete old file of same name VERIFY"FILENAME", 8 ; verify file 0 is the (internal) drive number. program "DOS Support" is shipped with the disk drive. then abbreviations are available: /filename load a program from disk > or @ read and display error channel >$ or @$ read and display directory >cmd or @cmd send command to drive BASIC commands: LOAD SAVE VERIFY OPEN PRINT# INPUT# GET# CLOSE STATUS KERNAL FFBA SETLFS (set addr) FFBD SETNAM (set length and address of filename) FFC0 OPEN FFC3 CLOSE FFC6 select file number for CHRIN FFC9 select file number for CHROUT FFCC clear all channels (unselect) FFCF read a byte from the current file (CHRIN) FFD2 write a byte to the current file (CHROUT) where file number is any value between 0 and 127 inclusive (hfile handle in computer). A "channel number" is the file handle in drive. 0 and 1 are reserved. 2 to 14 are data. 15 is cmd/err. PRINT#... a;b;c; otherwise PRINT# a,b,c seperates BY THE CURSOR RIGHT CHARACTER. INPUT# reads strings, until comma or CR. GET# receives single characters. See ST (STATUS) for end-of-file Drive will close files as soon as you close the error channel. Don't do it. DOS commands: "NEW:name,id" (2 chars ID) formats disk "NEW:name" clears directory "COPY:newfile=oldfile" copy a file (on the same disk). "COPY:newfile=f1,f2,f3,f4" copy max 4 files into 1 file. "RENAME:newname=oldname" rename a file. "SCRATCH:name" delete a file (may use wildcards) "INITIALIZE" closes any open files and reboots the drive. "VALIDATE" defragments the disk. "DUPLICATE" reserved for (non-existant) dual disk driver. "UI-" set VIC-20 (non-default) speed. "BLOCK-ALLOCATE: drive track block" "BLOCK-FREE: drive track block" "BLOCK-READ: channel drive track block" "BLOCK-WRITE: channel drive track block" "BLOCK-EXECUTE: channel drive track block" (until RTS) "BUFFER-POINTER: channel position" "USER1 (READ): channel drive track block" (block read with 255 fixed byte size) "USER2 (WRITE): channel drive track block" (block write with 255 fixed byte size) "POSITION", channel+96,record_lsb,record_msb [,position] "MEMORY-READ", address_lsb, address_msb "MEMORY-WRITE", address_lsb, address_msb, length, data[length] (up to 34 bytes at once) "MEMORY-EXECUTE", address_lsb, address_msb "Un" (user commands) "U3" jump to 0x0500 "U4" jump to 0x0503 "U5" jump to 0x0506 "U6" jump to 0x0509 "U7" jump to 0x050C "U8" jump to 0x050F "U;" jump to [FFFC] power up vector. error channel: NN error number NAME error name (displat string) TR and BL track and block number (etc) "NN,NAME,TR,BL",0x0d NN and TR and BL are in two-digit string format. clears on read. reading in BASIC: 10 OPEN 1,8,15 20 INPUT#1, A, B$, T, B 30 PRINT A, B$, T, B RUN max # sequential(!) files open at once: 5 direct access channels files open at once: 6 OPEN "[@]0:filename[,file_type,direction]" PRG sequential program SEQ sequential data file USR sequential user file REL (L) direction R or W. relative file is something similar though different: @ does NOT erase and re-create the file. Relative files can be expanded, read and written into. OPEN file_name_field: "filename,L,", record_length where record_length is BINARY (!!!) These files are split into records of fixed size, defined when creating the file. max 65535 records. "P", channel+96, record_lsb, record_msb [,character_position] where character_position is 1-based. Pos INSIDE the record. Random file no filename (no directory entry) only allocated in the BAM. access via TWO channels: command channel 15 and data channel (2..14). OPEN file_name_field: "\[n]" (optional n) where backslash is pound. disk format: tracks blocks 1..17 0..20 18..24 0..18 25..30 0..17 31..35 0..16 <--- in the center total 683 blocks. 19 blocks in track 18 are the directory. blocks in the center are allocated first by the DOS. track 18 sector 0: BAM 00,01 track and sector of first directory block (18,01) 02 ASCII character "A" indicating 4040 format (41h) 03 null flag for future DOS use. (00h) 04..8F bit map of AVAILABLE blocks for tracks 1..35. track 18, sector 0: directory header 90..a1 disk name 18 characters padded with shifted spaces. a2..a3 disk id two characters a4 shifted space (A0h) a5..a6 dos version "2" and format type "A" (32h, 41h) a6..a7 (shifted spaces (a0h, a0h) ab..FF nulls (00h ...) track 18, sectors 1..18: directory entry 00..01 track and sector of next directory block. 02..1F entry 1 22..3F entry 2 ... where entry: 128+type 0=DEL,1=SEQ,2=PROG,3=USER,4=REL 01,02 track and sector of 1st data block 03..12 filename, 16 chars, padded with a0h ??? relative file: track and sector for first side sector block ??? relative file only: record size 13..1b unused (zero filled) ??? track and sector of replacement file when OPEN@ is in effect. 1c..1d number of blocks in file: low byte, high byte. relative file format 00..01 track and block of next side sector block 02 side sector number (0..5) 03 record length 04..0f track and block of side sector number 0..5 10..ff track and block pointers to 120 data block data blocks: 00..01 track and block of next data block 02..ff 254 bytes of data.