Download MasterTool Programming, PONTO Series Programming

Transcript
Chapter 4
Instructions
The output invalid index is activated if the memory OPER2 contains a value which indexes a nonexistent position in the tables specified in OPER1. This can happen by modifying the memory
OPER2 in one point of the applications program outside of the instruction SEQ (in the Initialization
of OPER2, for example) or in the appropriate SEQ instruction, if any of the positions of the tables
specified in OPER1 contain invalid values for being the next status. Care should be taken to define
the 2 tables specified for OPER1 with the same size, and they should be initialized with legal values
(example: if the tables have 10 positions, only values between 0 and 9 should be loaded in positions
of this table, since only these can have legal status.
The conditions of evolution associated to the current status (OPER2) are determined with base in
OPER3 (next status is loaded starting from the first table) or with base in OPER4 (next status is
loaded starting from the second table. Knowing that the operands OPER3 and OPER4 are of memory
type (16 bits) or of auxiliary type (8 bits), suppose the following is the case:
ESTADO = contents of operand OPER2 (current status)
END3 = address of OPER3
END4 = address of OPER4
END1 = address of point to be tested, with base in OPER3
SUB1 = subdivision of point to be tested, with base in OPER3
END2 = address of point to be tested, with base in OPER4
SUB2 = subdivision of point to be tested, with base in OPER4
The points tested as evolution condition associated to each table are:
M<END1>.<SUB1> or A<SUB1> (first table) and M<END2>.<SUB2> or A<END2>.<SUB2>
(second table)
where:
END1 = END3 + STATUS/16 (if operand %M)
END1 = END3 + STATUS/8 (if operand %A)
SUB1 = REST (STATUS/16) (if operand % M)
SUB1 = REST (STATUS/8) (if operand % A)
END2 = END4 +STATUS/16 (if operand % M)
END2 = END4 + STATUS/8 (if operand % A)
SUB2 = REST (STATUS/16) (if operand % M)
SUB2 = REST (STATUS/8) (if operand % A)
Example:
They may be:
OPER1 = %TM000
OPER2 = %M0010
OPER3 = %M0100
OPER4 = %A0020
108