Library item - Method

The source code included is treated as sub program. There is a call to the corresponding labels as subroutine calls. The first parameter or a real value assignment is made in the register block A, so register _HA0 to _HA3 (depending on the value of width). All further on the stack. These are fetched in the order of declaration (from left to right) from the stack. Before you pick up the other parameters, you have to pop/push the return address with the built-assembler macros „PopPC“ and „PushPC“ (see standard library) from the stack and back.

In one method, the indication of the correct label is necessary. More than one parameter (Counted including a defined assignment if necessary) is popped from the stack:

Note

If a real value assignment (no text replacement) used in a method / inline method, the displaced These, if necessary. available first parameter. That The first parameter will no longer end up in the register block A but like all the other parameters on the stack. The register block A is then the value assignment (see below).

The graphical parameter editor automatically changes a corresponding target (stack / RegA).

Method with return value

A return value is expected in the register block A. To declare a method as a function with return value, choose the desired option and the data type. An optional return is also possible. Here, the compiler ignores then the Luna-code the return value if it is not used.

Method with assignment

Alternatively, an assignment can be configured. It should be noted that it is the actual parameters (if any), are stored on the stack. The value of the assignment is stored in the register block A.