Patent ID: 7421459

Claim:
A method for transferring data between a host device and a storage medium via a buffer, comprising: receiving from the host device a command to transfer data between the host device and the storage medium; storing in a first register a value for tracking a number of sectors in the buffer available for storing data units; storing in a second register a vault, corresponding to a number of data units to transfer during an iteration of the transfer of the data between the host device and the storage medium; transferring the number of the data units into the buffer from one of the host device and the storage medium responsive to the command; modifying the value contained in the first register with the value stored in the second register in response to a completed iteration of the transfer of the data into the buffer; transferring the number of the data units out of the buffer and to another of the host device and the storage medium; and modifying the value contained in the first register in response to a transfer of the data units out of the buffer, wherein, during the transfer of the data between the host device and the storage medium, the value contained in the first register corresponds to a number of data units currently stored in the buffer, and wherein modifying the value contained in the first register with the value stored in the second register is accomplished by decrementing the value contained in the first register by the value stored in the second register.