\ 30 -BSIO documentation dlm17jul83 ;s The following screens add several new words to FORTH. These words are: -BSIO......This word replaces -DISC as the fundamental disk I/O word in FORTH. It adds the ability to handle double density (256 byte) sectors and the ability to write with-out verify. USE-BSIO...This word installs -BSIO as the disk I/O word, all words that call -DISC now will call -BSIO. USE-DISC...This word installs -DISC as the disk I/O word, it undoes the change that USE-BSIO made. DOUBLE.....Sets FORTH up in double density mode, all systems constants are changed to the values needed for double density screens. It also sets D1 to double density operation. \ 31 DOC continued dlm17jul83 ;s SINGLE.....This word resets all FORTH constants back to their single density values. It also switches D1 to single density. VERIFY.....Sets write with verify. NO.VERIFY..Sets write without verify. CHK.DRIVE..Checks the configuration of the drive whose number is on the stack. SET.DRIVE..Reconfigures the drive whose number is on the stack. The variable DENSITY controls the density the drive will be set to. The constant C/BUF should be set to either 120 (single) or 240 (double) in pns-FORTH, in val-FORTH the values should be 128 and 256. If you have val-FORTHyou should change SINGLE and DOUBLE to set the different values into the constant. \ 32 -BSIO, single or double dlm20nov82 hex 57 variable WCMND \ type of write 1 variable DENSITY code -BSIO \ --- 0 ,x lda, 0= not \ read or write if, 52 # lda, 40 # ldy, else, wcmnd lda, 80 # ldy, then, 302 sta, 303 sty, 1 # lda, 301 sta, \ set the unit # to 1 2 ,x lda, \ get drive # and compute the clc, 30 # adc, 300 sta, \ device id 4 ,x lda, 30a sta, 5 ,x lda, 30b sta, 6 ,x lda, 304 sta, 7 ,x lda, 305 sta, density lda, 1 # cmp, 0= if, 80 # lda, 00 # ldy, \ single else, 00 # lda, 01 # ldy, \ double then, 308 sta, 309 sty, 0f # lda, 306 sta, \ time out value xsave stx, e459 jsr, 0< \ error? if, 303 lda, else, 00 # lda, then, xsave ldx, 6 ,x sta, 00 # lda, 7 ,x sta, inx, inx, poptwo jmp, end-code decimal --> \ 33 Percom disk control dlm12sep82 hex code SIO \ <>---<> xsave stx, e459 jsr, xsave ldx, next jmp, end-code 12 c-array BUFF : SET.CALL \ ---<> 30 + 300 c! \ set SIO unit number 0 buff 304 ! 1 30a ! c 308 ! ; : READ.DRIVE \ ---<> set.call 4e 302 c! \ Read drive table 40 303 c! sio ; : WRITE.DRIVE \ ---<> set.call 4f 302 c! \ Write drive table 80 303 c! sio ; decimal --> \ 34 Percom disk control dlm04sep82 : CHK.DRIVE \ ---<> read.drive 0 buff c@ 4 .r ." tracks" cr 1 buff @ 4 .r ." step rate" cr 3 buff c@ 4 .r ." sectors/track" cr 4 buff c@ 5 spaces if ." double" else ." single" then ." sided" cr 5 buff c@ 5 spaces if ." double" else ." single" then ." density" cr 6 buff c@ 256 * 7 buff c@ + 4 .r ." bytes/sector" cr ; : SET.DRIVE \ ---<> dup read.drive density @ 1 = if 0 5 buff c! 32768 6 buff ! ( SD ) else 4 5 buff c! 1 6 buff ! ( DD ) then write.drive ; --> \ 35 -BSIO, control words dlm02sep82 : VERIFY 87 wcmnd ! ; : NO.VERIFY 80 wcmnd ! ; \ assume drive number one : SINGLE \ Set single density operation 8 ' b/scr ! 128 ' b/buf ! 120 ' c/buf ! 1 density ! 1 set.drive 4 buffers ; : DOUBLE \ set double density operation 4 ' b/scr ! 256 ' b/buf ! 240 ' c/buf ! 2 density ! 1 set.drive 4 buffers ; : USE-BSIO ' -bsio [ ' -disc cfa ] literal ! ; : USE-DISC ' -disc [ ' -disc cfa ] literal ! ; ;s