218
Comparison Instructions Section 3-6
Example:
When C = 39 hex, the rightmost 6 bits are 111001 (year=1, month=1, day=1,
hours=0, minutes=0, and seconds=1) so only the hours and minutes are com-
pared. This mask setting can be used to perform a particular operation at a
given time (hour and minute) each day.
Previous data comparison instructions compared data in 16-bit units. The
time comparison instructions are limited to comparing 8-bit time values.
The following table shows the structure of the CPU Unit’s internal Calendar/
Clock Area.
The Calendar/Clock Area can be set with the CX-Programmer, DATE(735)
instruction, or “CLOCK WRITE” FINS command (0702 hex).
Summary of Time Comparison Instructions
The following table shows the function codes, mnemonics, names, and func-
tions of the 18 time comparison instructions.
Addresses Contents
A351.00 to A351.07 Second (00 to 59, BCD)
A351.08 to A351.15 Minute (00 to 59, BCD)
A352.00 to A352.07 Hour (00 to 23, BCD)
A352.08 to A352.15 Day of month (01 to 31, BCD)
A353.00 to A353.07 Month (01 to 12, BCD)
A353.08 to A353.15 Year (00 to 99, BCD)
Code Mnemonic Name Function
341 LD= DT LOAD EQUAL True if
S1 = S2
AND=DT AND EQUAL
OR=DT OR EQUAL
342 LD<>DT LOAD NOT EQUAL True if
S1 ≠ S2
AND<>DT AND NOT EQUAL
OR<>DT OR NOT EQUAL
343 LD<DT LOAD LESS THAN True if
S1 < S2
AND<DT AND LESS THAN
OR<DT OR LESS THAN
344 LD<=DT LOAD LESS THAN OR EQUAL True if
S1 ≤ S2
AND<=DT AND LESS THAN OR EQUAL
OR<=DT OR LESS THAN OR EQUAL
345 LD>DT LOAD GREATER THAN True if
S1 > S2
AND>DT AND GREATER THAN
OR>DT OR GREATER THAN
00070815
S
1
S1+1
S
1+2
00070815
S
2
S2+1
S
2+2
Present time data Comparison time data
Compares only hours and
minutes data.
Year, month, day, and seconds
data is masked.
Second (00 to
59, BCD)
Second (00 to
59, BCD)
Minute (00 to
59, BCD)
Minute (00 to
59, BCD)
Hour (00 to
23, BCD)
Hour (00 to
23, BCD)
Day of month
(01 to 31, BCD)
Day of month
(01 to 31, BCD)
Month (01 to
12, BCD)
Month (01 to
12, BCD)
Year (00 to
99, BCD)
Year (00 to
99, BCD)