[Next] [Up] [Previous]

The ADDRESS Statement

The ADDRESS statement

       ADDRESS IV

declares that IV may contain a memory address. The argument of a JUMP statement should be of type ADDRESS or ADDRESS(LABEL).

The ADDRESS statement

ADDRESS(REAL) IY

declares that IY contains an address, and that that address is to be assumed by the program to point to a real number.

The function _CON(address), which gives the contents of the address which is its argument, cannot be used at any point where its result may be subject to implicit type conversion (which means in most places in expressions, except, for example, as a MEMORY type argument to a subprogram) unless its argument is a typed address.

Note that _CON is also usable as a LEFT_FUNCTION, and in that position, the restriction on implicit type conversion does not apply.

Note that, given IY as declared above,

       . IY=%25

will not result in either an execution-time or a compile-time error, unless extended error-checking (which may be the default in FULL mode) is specified; the associated type of a typed address represents something to be assumed, not something to be enforced. (It is, however, encouraged to generate an advisory or nonfatal error message in such cases!)

Also, type conversion between ADDRESS and INTEGER variables, including implicit conversion, is allowed by FALCON even where integer arithmetic on an address will not produce valid results, provided that an address can fit in an INTEGER variable. (Where LONG variables must be used instead, this MUST be documented. Note that pure integer form for addresses is strongly preferred whenever feasible. Use of segment:offset form within ADDRESS variables with conversion to pure integer form in an INTEGER variable is recommended when segment:offset form can provide added efficiency in an implementation.)


[Next] [Up] [Previous]