Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

ALIASFN

Since version 2.2

Syntax:

aliasfn <const int address>, "<function name>"

The ALIASFN directive registers a new function alias in order to make it possible to call a user function without the USR keyword. This directive is mainly used in extensions.

The function name must be a valid identifier - i. e. it starts with an alpha char or underscore and contains alphanumeric chars and underscores only. It may be appended with a sigil - any of these characters: !#%$ indicating that the function alias refers to a function that returns a specific type. The default is # (integer).

The same alias for different types is allowed and encouraged, for example you can define the aliases myFunc! and myFunc# that point to different addresses.

Example:

aliasfn $c000, "myfunc"

rem -- Assuming that a machine code function resides at address $C000,
rem -- the following two function calls are identical:

x = usr($c000, arg1, arg2)
y = myfunc(arg1, arg2)