OSWORD &72
OSWORD &72 (114) - Perform SCSI/MFM disk operation
Contents
Specification
On entry: XY?0 = 0, returned result XY!1 = data address XY?5 = command XY?6 = drive number in b5-b7, sector b16-b20 in b0-b4 XY?7 = sector number b8-b15 XY?8 = sector number b0-b7 XY?9 = number of sectors or 0 XY?10 = 0 XY!11 = data length if X%?9=0
This is a standard SCSI command block. The drive number in XY?6 is ORed with the current drive. If ADFS is not selected when the call is made, ADFS is selected. Consequently, any code that calls OSWORD &72 must remember the current filing system and restore it afterwards.
Commands
&00=Test drive ready &01=Seek track 0 &03=Request status &08=Read data &0A=Write data &0B=Seek track &1B=Stop/Start drive; stop if XY?9=0, start if XY?9=1
Results
&00=Ok &02=Drive door open &03=Media error, eg disk dirty &05=Bad SCSI command &04=Not ready &40=Write protected &48=CRC error &50=Sector not found &60=Bad command &61=Bad address &63=Volume error &65=Bad drive &6F=Abort
The result byte can be preloaded with a value to return if no OSWORD &72 routine exists. For instance, preloading the result with &00 makes all such failed calls appear to succeed, preloading with &50 makes all calls appear to return 'Sector not found'.
Coding
The following routine can be used to perform an OSWORD &72 call. It requires X%=>15-byte control block, Y%=X%DIV256.
DEFFNscsi(cmd%,addr%,num%,sect%,drv%):LOCALfs% fs%=FNfs:IFfs%<>8:*FX143,18,8 X%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%AND&1F0000)DIV65536) X%?7=((sect%AND&FF00)DIV256):X%?8=sect%:X%!9=0:X%!11=num% A%=&72:CALL&FFF1:A%=?X%:IFfs%<>8:OSCLI"FX143,18,"+STR$ fs% =A% DEFFNfs:LOCALA%,E%,Y%:=(USR&FFDA)AND&FF
Cumana Electron DFS disk access
The Cumana Double Densisty Electron DFS implments the following OSWORD &72 call:
On entry: XY?0 = Control byte, b0: side select 0,1 b1: drive 1 select b2: drive 2 select b3: 0=double density, 1=single density XY?1 = command XY?2 = track XY?3 = sector XY?4 = data XY!5 = address XY?9 = 0, holds result on exit
Commands
&04=Seek track zero &14=Seek track &50=Step in one track &70=Step out one track &80=Read sector &A0=Write sector b0-b1=step rate 6ms/12ms/20ms/30ms
Results
XY?2=new track XY?3=new sector XY?9=result &00=Ok
See Also
Jgharston 14:06, 26 May 2009 (UTC)