OSWORD &7F - Single Density Disk Access ======================================= OSWORD &7F passes an 8271-style control block to the floppy disk controller to access disks. Double-density DFSs also allow OSWORD &7F to access double-density disks. On extry: XY+0 drive number %pxDDDdsd XY+1..4 data address XY+5 number of parameters XY+6 command XY+7... parameters XY+n returned result The drive number is expressed as a binary number %pxDDDdsd. p : If 1, selects the previously-used drive and density DDD : select the drive density: %xx0=Acorn single density %xx1=Acorn double density %0xx=Watford current density %10x=Watford single density %11x=Watford double density dd : physical drive number s : side Single density DFSs do not have any ability to select double density disk access. Acorn DFSs select the density with b3, Watford DFSs select the density with b4 and b5. To specify a density in a manner compatible with both Acorn and Watford DFSs specify the density with both methods: %001000sd - to specify single density %001110sd - to specify double density Most DFSs do not implement physical drives numbers larger than 1 (logical drives greater than 3). Selecting the previously selected drive can only be relied upon if DFS is the currently selected filing system. A drive number of &FF should be passed to select the previously used drive. No contents of the control block should be relied upon on exit other than the result byte. Some systems update the control block, some systems do not. Some DFSs, such as DFS 2.45 supplied in the Master MOS 3.50 ROM, only respond to OSWORD &7F if DFS is the current filing system and fail silently if any other filing system is selected. DFS 2.24 in the Master MOS 3.20 ROM incorrectly passes the density bit in b3 to the drive control register b3 instead of b5, so OSWORD &7F cannot access double density disks. Commands ======== &4B=Write sectors, &03 &4B Track Sector Count+Size &53=Read sectors, &03 &53 Track Sector Count+Size &63=Format track, &05 &63 Track .... &69=Seek track. &01 &69 Track Results returned are: &00=ok, &08=Clock error, &0A=Late DMA, &0C=CRC error in ID, &0E=CRC error in data, &10=Drive not ready, &12=Write protected, &14=Track 0 not found, &16=Write fault, &18=Sector not found, &FE=8271 command unknown. If &10 'Drive not ready' is returned, it should be ignored and the call made again. The following function can be used to perform an OSWORD &7F call that takes three parameters, such as Write (&4B) and Read (&53). It requires X%=>15-byte control block, Y%=X%DIV256. DEFFNdisk(addr%,cmd%,drv%,trk%,sec%,num%,den%):LOCAL fs% fs%=FNfs:IF fs%<>4:*FX143,18,4 REPEAT X%?0=drv%+den%*24+32:X%!1=addr%:X%?5=3 X%?6=cmd%:X%?7=trk%:X%?8=sec%:X%?9=num%OR&20 A%=127:CALL&FFF1:A%=X%?10 UNTIL A%<>&10:IF fs%<>4:OSCLI"FX143,18,"+STR$ fs% =A% DEFFNfs:LOCAL A%,E%,Y%:=(USR&FFDA)AND&FF