Amos Professional Manual  Contents  Index

Libraries and Devices


LVO
function: get the Library Vector Offset
offset=Lvo("Name_of_the_function")

This function returns the Library Vector Offset associated with a specified function. The function name will be translated automatically when your program is tested for the first time, and it will be placed in a memory bank for future use. Set up the memory bank with a SET EQUATE BANK command first, otherwise an error message will be generated. If the function name does not exist, an "Equate not found error" will be given from the Editor.

The function name is in standard Commodore format, and should be typed in exactly as it appears in your reference manuals. This is especially important regarding the way upper case letters are treated differently from their lower case equivalents. For example, Input, INPUT and input are separate keywords, only the first version will be accepted, and either of the alternatives will generate an error when the program is tested!

Also note that because the function is executed during the testing process, it must be a simple string rather than an expression. For example, if you need to call the FindTask option from Exec, you would use a line like this:

X> TASK=Execall(Lvo("FindTask"))

EQU
function: get an equate
value=Equ("Name_of_the_equate")

The EQU function returns any standard equate value used by the Amiga system libraries. The equate can represent anything from an offset to a structure, or even the names of various bit- masks. Provided that it is supplied in the standard Amiga include files, it will be available from AMOS Professional immediately. The only exceptions to this rule are the library offsets, and these should be obtained with the LVO function.

The name of the equate should be specified in brackets, and refers to the name as set out in your reference manuals. This name is case sensitive, as explained above, so care should be taken. It is also important to remember that the name string must be a constant, and that expressions are not allowed! In fact, the technique is extremely simple. This example would send a WRITE command to a device:

X> DEV D0(channel,EQU("CMD_WRITE"))

STRUC
reserved variable: access an internal data structure
value=Struc(address,"Offset Name")
Struc(address,"Offset_Name")=value

The STRUC reserved variable provides a simple way of assigning a value to any one of the elements of a system structure, and it is intelligent!

Back    Next
11.05.04