The LE instruction is a compare instruction. The LE instruction compares S1 with S2.
Be careful when comparing real values. Be careful when comparing real values. For example, if the operand is 2.000000000001, it is not less than or equal to 2. When using the LE 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
LE
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 or equal to the operation result. If the result of the LE instruction is S1 <= S2, the LE instruction passes power. Then the instruction to the right of the LE instruction is executed. In the above diagram, it's the MOV instruction.