Amos Professional Manual  Contents  Index

Samples


SLOAD
instruction: load a section of a sample
Sload channel number To address,length

The SLOAD instruction is an extended version of the BLOAD command, and it is designed to load selected parts of a file into memory, one section at a time.

First give the channel number of a sample file stored on disc, which has been previously opened with an OPEN IN instruction. This is followed by the destination address of the data in memory. This will normally be the start address of an AMOS Professional memory bank. Finally, the length of the sample section is given, in the form of the number of bytes to be loaded into memory. These bytes will be loaded directly from the current position of the file pointer, and this pointer may be moved anywhere in the file, using the POF function. This means that you have complete control over the starting point of the loading operation. Obviously, if the requested position lies outside of the current file, an error will be reported. If the length is larger than the actual file, AMOS Professional will read all of the remaining bytes up to the end of the file.

After the data has been successfully loaded, the file pointer will be moved to the next byte in the sample automatically.

It should be apparent that the SLOAD command can be used for applications other than sample loading. It will work equally well with any drive, including the internal floppy drive, but only a hard disc, Ram-disc or CD ROM will be fast enough to load samples, for use with the SAM SWAP command! This is explained below.

SSAVE
instruction: save a data chunk anywhere into an existing file
Ssave channel number, start To end

This command is the reverse of SLOAD. It allows you to save a chunk of memory data into a file opened with OPEN OUT or APPEND. Use the LOF, POF and EOF functions to control where you want to position the data within the file.

Back    Next
08.02.05