Amos Professional Manual  Contents  Index

Libraries and Devices


The function offset parameter holds the offset value to the library function that you wish to execute, and if it is entered directly this value must be exact. Any mistakes will crash the computer. Alternatively, you are recommended to use a safer method via the LVO function to call the command by name, which is explained below.

Before calling this function, the appropriate parameter values need to be loaded into the Address and Data registers, using the AREG and DREG commands. The precise format of these parameters depends on the function in question, and should be checked from the appropriate reference manual.

After the function has been successfully executed, any return values will be available for immediate use from the AREG and DREG variables. Note that AREG only allows the registers from A0 to A3 to be accessed. (Registers A4, A5 and A6 are not used by the libraries at all.)

LIB BASE
function: get the base address of the library
address=Lib Base(channel number)

LIB BASE is used to return the base address of the selected library. This can be used in conjunction with the STRUC function to manipulate the internal data structures directly. Obviously, the normal PEEK and POKE functions can be used for this purpose as well.

DOSCALL
function: execute function from DOS library
result=Doscall(function offset)

DOSCALL executes a function directly from the DOS library, with the offset to the appropriate function being specified in brackets. The selected command is executed straight from an AMOS Professional program, without the need to open the DOS library in your program. This is useful for single calls to an important routine.

The offset value can either be a simple number or a named function using the LVO command. As with LIB CALL, the control registers first need to be set up carefully. These values should be placed into D0 to D7 and A0 to A3, with the aid of the AREG and DREG functions. After the command has been executed, the result will be given as the return value in D0. Please note that the contents of the other registers will not be loaded back into AREG and DREG.

EXECALL
function: call EXEC library
result=Execall(function offset)

The EXECALL function performs a call to the Amiga's EXEC library, with the specified offset value. On entry, D0 to D7 and A0 to A2 must be loaded with the control settings required by the function. A value is returned holding the contents of D0.

Back    Next
11.05.02