DATE SUB
DATE-, DATE-P
DATE- instruction subtracts clock data S2 from S1 and saves the result to the Destination.
| |
S1 | Starting address of clock data |
S2 | Starting address of clock data |
D | Destination |
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. | Error | Zero | Carry | |||
DATE- DATE-P | S1 | o | o | o | o | o | o | o | o | - | o | o | o | - | 4 | o | - | - |
S2 | o | o | o | o | o | o | o | o | - | o | o | o | - | |||||
D | o | - | o | o | o | - | o | o | - | o | o | o | - |
When enabled, DATE- instruction subtracts clock date S2 from S1 and saves the result to the Destination.
If the result has (-)minus value, add 24 to the result.
For example, in case of 4:50:32 - 10:42:12, the result is 18:8:20. (Not -6:8:20)
If S1 and S2 are out or range, Error flag will be turned ON.
Example)
If X01 is ON, the DATERDP instruction writes a date value to D100 ~ D106 and then DATE-P instruction subtracts time data (D10~D12) from (D103~D105) and saves the result to the D200~D202.