From BeebWiki
Revision as of 00:25, 18 March 2014 by Jgh (talk)
Jump to: navigation, search

OSWORD &62 (98 ) - Access LVROM controller


   Same format as ADFS call &72 (114)
   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 VFS is not selected when the call is made, VFS is selected. Consequently, any code that calls OSWORD &62 must remember the current filing system and restore it afterwards. In practice it is easier to select VFS before calling OSWORD &62.


   &00=Test drive ready
   &01=Seek track 0
   &03=Request status
   &08=Read data
   &0B=Seek track
   &1B=Stop/Start drive; stop if XY?9=0, start if XY?9=1
   &C8=Read F-code result from LVDOS
   &CA=Transmit F-code to LVDOS


   &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

The result byte can be preloaded with a value to return if no OSWORD &62 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'.


The following routine can be used to perform an OSWORD &62 call. It requires X%=>15-byte control block, Y%=X%DIV256.


See Also

Jgharston 14:00, 26 May 2009 (UTC)