AKD BASIC User Guide | 3 AKDBASICLanguage
The interrupt is re-enabled by the statement INTR.DIN1LO = 1. A similar statement must be
executed once before the interrupt is serviced. It is a run-time error to attempt to enable an inter-
rupt for which no handler is defined.
Interrupt handlers do not return values and cannot have arguments. They declare local var-
iables, constants, and aliases. Interrupt handlers are invoked when the AKD hardware detects
that the designated interrupt condition is satisfied (provided that the interrupt is enabled).
Interrupts are triggered by pre-defined events or external hardware sources. The interrupt-
source-name and interrupt enable flag are unique for each interrupt source.
Receiving an interrupt will suspend program execution and the interrupt service routine will be
executed. Then program execution will resume at the point that it was interrupted.
Interrupts are enabled (or disabled) by setting (or clearing) the associated interrupt enable flag.
Interrupts are disabled until explicitly enabled. After an interrupt is triggered it is automatically
disabled until it is enabled again in your program.
3.4 Language Definition
3.4.1 Lexical Conventions
AKD BASIC is case-insensitive. String literals are not modified, but all other text is treated as if
it were entered in upper case. This means that the identifiers spin, Spin, and SPIN all refer to
the same entity.
3.4.2 Identifiers
Identifiers are alphanumeric and must start with an alphabetic character or underscore. In addi-
tion, they may include the underscore character (‘_’) and dollar sign (‘$’). Identifiers denote var-
iables, functions, subroutines, and statement labels, symbolic constants, and aliases.
Identifiers are a maximum of 40 characters. User-defined identifiers may not include the period
(‘.’). Use of a longer identifier is a compile-time error.
Although both forms are accepted for compatibility, the latter form is preferred. Although AKD
BASIC is case-insensitive, we recommend that you adopt a consistent naming convention,
such as Move.Acc, and avoid having Move.acc, move.acc, and move.Acc in the same pro-
gram.
3.4.3 Data Types
The pre-defined types are INTEGER, FLOAT, and STRING. LONG is used for INTEGER.
INTEGER variables are 32-bit signed integers. FLOAT variables are IEEE single-precision
floating point numbers. STRING variables are represented internally as a maximum length, a
current length, and an array of ASCII characters (can contain null characters).
When a FLOAT result is assigned to an INTEGER variable, or when a FLOAT argument is
used where an INTEGER is expected, the value is coerced to an integer before use. Coercion
from FLOAT to INT always rounds to the nearest integer. For example:
1.2 rounds to 1
1.7 rounds to 2
-1.2 rounds to –1
-1.7 rounds to -2
Scalar INTEGER and FLOAT coercion is automatically provided for function arguments. When
passing ARRAYS as arguments, the types must match exactly because coercion is pro-
hibitively expensive at run-time.
Kollmorgenâ„¢ | March 30, 2012 26