Vai al contenuto

Syntax of IL Instructions

IL code is composed of a sequence of instructions. Each instruction begins on a new line and contains an operator with optional modifiers, and, if necessary for the particular operation, one or more operands separated by commas. Operands can be any of the data representations for literals and for variables.The instruction can be preceded by an identifying label followed by a colon (:). Empty lines can be inserted between instructions.ExamplesLet us parse a small piece of code:START:LD %IX1 (* Push button *)ANDN %MX5.4 (* Not inhibited *)ST %QX2 (* Fan out *)The elements making up each instruction are classified as follows:
LabelOperator[+ modifier]OperandComment
START:LD%IX1(* Push button *)
ANDN%MX5.4(* Not inhibited *)
ST%QX2(* Fan out *)
Semantics of IL Instructions
  • Accumulator
By accumulator a register is meant containing the value of the currently evaluated result.
  • Operators
Unless otherwise specified, the semantics of the operators is:accumulator := accumulator OP operandThat is, the value of the accumulator is replaced by the result yielded by operation OP applied to the current value of the accumulator itself, with respect to the operand. For instance, the instruction “AND %IX1” is interpreted as:accumulator := accumulator AND %IX1and the instruction “GT %IW10” will have the Boolean result TRUE if the current value of the accumulator is greater than the value of input word 10, and the Boolean result FALSE otherwise:accumulator := accumulator GT %IW10
  • Modifiers
The modifier “N” indicates bitwise negation of the operand.The left parenthesis modifier “(” indicates that evaluation of the operator must be deferred until a right parenthesis operator “)” is encountered. The form of a parenthesized sequence of instructions is shown below, referred to the instruction:accumulator := accumulator AND (%MX1.3 OR %MX1.4)The modifier “C” indicates that the associated instruction can be performed only if the value of the currently evaluated result is Boolean 1 (or Boolean 0 if the operator is combined with the “N” modifier).