32.18.3.3 Explanation of the LT Instruction
The LT instruction is a compare instruction. The LT instruction
compares S1 with S2. If the result of the comparison is S1 < S2,
the instruction passes power. Be careful when comparing real
values. For example, if the operand value is 1.99999999999, it is
still less than 2. When using the LT instruction, an error will
occur if the variables specified in operands S1 and S2 are not the
same type. Designate the same variable type in all operands S1 and
S2.
Refer to the following for specifying a constant.
When operand S1 or S2 is an integer
constant
When entering hexadecimal values in operands
S1 or S2
When 0x (zero and lower case "x") is input, the following values
become hexadecimal values.
When entering float constants in operands S1
or S2
When 0f (zero and lower case "f") is input, the following values
are interpreted as float values.
When entering real constants in operands S1
or S2
When 0r (zero and lower case "r") is input, the following values
are interpreted as real values.
When Comparing Data in a Specified Array
(Integer Variable Array)
Specify the array using Data [0] or Data [N] (N indicates an
integer variable).
When operands S1 and S2 specify the entire array, an error will
occur even if the specified variables are the same type.
Program Example
LT
Compares integer variables and outputs the result in D1.
-
Data_A and the operation result are compared to
determine whether Data_A is less than the operation result. If the
result of the LT instruction is S1 < S2, the LT instruction
passes power. Then the instruction to the right of the LT
instruction is executed. In the above diagram, it's the MOV
instruction.
|