Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FileRwabs() BIOSSyntaxLONG Rwabs( mode, buf, count, recno, dev, lrecno )
WORD mode;
VOIDP buf;
WORD count,recno,dev;
LONG lrecno;
Function Rwabs() reads and writes sectors to a mounted device.
Opcode 4 (0x04)
Availability All TOSversions. Hard disk access requires the use of
a hard disk driver (such as AHDI). The long sector offset
version is only available as of AHDI 3.0. AHDI version
numbers can be inquired through system variable pun_ptr (see
discussion earlier in this chapter).
Parameters mode is a bit mask which effects the operation to be
performed as follows:
Name Bit Meaning
RW_READ or 0 0 = Read, 1 = Write
RW_WRITE
RW_NOMEDIACH 1 Do not read or modify the media change
status.
RW_NORETRIES 2 Disable retries
RW_NOTRANSLATE 3 Do not translate logical sectors into
physical sectors (recno specifies
physical instead of logical sectors)
The read or write operation is performed at address buf. buf must be count * bytes per logical sector in logical mode or
count * 512 bytes in physical mode. count specifies how many
sectors will be transferred.
dev specifies the index of the mounted device.
In logical mode, 'C:' is 2, 'D:' is 3, etc...
In physical mode, devices 2-9 are the ACSI devices
and 10-17 are SCSI devices. recno specifies the first sector
to read from. If you need to specify a long offset, set
recno to -1 and pass the long value in lrecno. When using
a version of the AHDI below 3.0, the parameter lrecno should
not be passed.
Binding /* If running AHDI <3.0 omit first parameter */
move.l lrecno,-(sp)
move.w dev,-(sp)
move.w recno,-(sp)
move.w count,-(sp)
pea buf,-(sp)
move.w mode,-(sp)
move.w #$04,-(sp)
trap #13
lea 18(sp),sp
Return Value Rwabs() returns E_OK (0) if successful or a negative BIOS error code otherwise.
Comments Some C compilers (Lattice C in particular) have a secondary
binding called Lrwabs() used to pass the additional
parameter. This function may invoke the critical error
handler (etv_critic).