BURST I/O
The CIO is designed to fill or empty a large user buffer with data bytes
sent to or received from a device handler, a byte at a time. To fill a
thousand-byte buffer, CIO would have to call FMS one thousand times in
rapid succession. While the process is simple and easy to implement by
both CIO and the Device Handlers, it can be very slow. This is particularly
true in the case of FMS which has a great deal of overhead code to go through
each time it is called. FMS circumvents most of the CIO/FMS calls for large
data transfers via the BURST I/O routines.
Burst I/O operates by reading or writing data sectors directly into
the user buffer (Figure 1, data path I). There are a number of tests that
must he passed before a burst I/O operation can take place. If any of the
tests fail, then the CIOIFMS data transfer reverts to the normal mode of
operation.
When the PUT BYTE routine is called, it will call the WTBUR ($A1F)
routine when it is ready to start filling a new data sector. WTBUR will
not allow a burst I/O operation to happen if the file has been opened for
Update. If the file has not been opened for Update, then WTBUR goes to
the common read/write burst I/O test routine, TBURST at $A28. If the file
has been opened for Update, then exit Burst I/O indicating that a Burst
I/O did not happen. When WTBUR calls TBURST, it has the A register set
to non-zero to indicate that it is write.
When the GET BYTE routine is called, it will call the RTBUR ($A26)
routine when it is ready to read a new data sector. RTBUR indicates that
it is read by setting the A register to zero and then enters TBURST.
TBURST
1) Save the A register in BURTYP. This value will indicate if the burst operation is a read or a write.BBINC
2) If the I/O command in the IOCB is for text I/O (a transfer that is to end when the Atari end-of-line ($9B) character is transferred), then TBURST will exit indicating (carry set) that a burst I/O operation did not occur.
3) If the user buffer length in the IOCB is not at least a full sector in size, then exit without doing a burst I/O.
4) If all the above tests pass, then perform a burst I/O operation. The first step in the burst I/O operation is to change the zero page sector buffer pointer, ZXBA ($47) from the FMS sector buffer address to the user buffer address.
5) If the operation is read, then read the next sector via RDNXTS. If the read sector operation produced an end-of-file, then go to BUREOF, else go to BBINC.
6) If the operation is write, then the area in the user buffer, where the three bytes of data sector control information is to be placed, will be saved. The data will be written via the WRTNXS routine. The saved user data will then be copied back into the user buffer. The code then continues at BBINC.
The BBINC routine is entered after a single burst I/O sector has been read or written. BBINC updates data counters in the FCB and in the IOCB and tests for the end of the Burst I/O.
1) The zero page sector buffer pointer is incremented by the length of data in a sector (125 or 253).BUREOF
2) The user buffer length is decremented by the length of data in a sector.
3) The TBLEN routine is called to determine if there is enough room left in the user buffer to read or write another full sector (128 or 256 bytes). If another sector can he read or written, then the process repeats at NXTBUR ($A3E).
4) If there is not enough room in the user buffer to perform another full sector read or write, then BUREOF is entered.
1) The final address in the zero page sector pointer, ZSBA ($47), is moved to the IOCB buffer address field.
2) The value in the zero page sector buffer pointer is restored by the SSBA routine.
3) The caller is returned to with the carry cleared to indicate that a burst I/O operation has happened.
Return to Table of Contents | Previous Chapter | Next Chapter