Commodore vic-1540 User Manual page 63

Table of Contents

Advertisement

520© REM *#*************♦*****•+•*
5281 REM * FDD BLOCK WRITE
*
5292 REM ******♦♦**#***♦***+•+***
5210 G0SUB5339
5220 PRINT#15 >"B-P =";CH; FP
5230 FORFI=1TOFX: PR I HT#CH, FBI- < FI >■; £HR* < 13), = NEXT
5240 PRINT*15>"U2:";CH;FD;FT;FS
5250 GOSUB5270
5260 RETURN
5270 REM ♦**♦**♦+**♦*****♦•*♦*♦•**
5275 REM *
ERROR CHECK
*
527S REM **###♦**♦***#***#**♦***
5280 INPUT#15,EN,EM*,ET,ES
5290 IFEN=0THENRETURN
5390 PRINT"ERROR STflTUS:",EN;EM*;ET;ES
53101HPUT"CONTINUE?">V*:IFY$="V"THEHRETURN
5320 STOP
5322 REM **##******#*#**********
5324 REM * SET TRflCK & SECTOR
*
5326 REM ***********************
5330 IFF<358THENF1=0:F2=22 = F3=1=GOTO5370
5340 IFF>357RNDF<471TRENF1=357:F2=20 = F3=19:GOTO5370
5350 IFF*>471RNDFO88THENF 1=4?1-F2=19: F3=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 5320 in the above are the error check routine. Also
indicated in above by GOSUB 5330 is a subroutine which is for allocating a
sector in the disk.
A track and sector must be designated in the random access which is rather
troublesome and, therefore, a concept of record number is used here to reduce
the burden of the programmer. For example, serial numbers as shown in Table
below are assigned to the sector 0 in the track 1 to the sector 16 of the track 35,
in VIC-1540. These serial numbers are called as the record number, which is in-
56

Advertisement

Table of Contents
loading

Table of Contents