7 APPLICATION INSTRUCTION
7.16 Check code
545
7
• These instructions calculate the addition data and horizontal parity value of data stored in (s) to (s)+(n)-1. The addition data
is stored to (d), and the horizontal parity value is stored to (d)+1. The 16-bit mode and 8-bit mode are available for these
instructions. For the operation in each mode, refer to the proceeding pages.
• 16-bit conversion mode (while SM8161 is OFF)
With regard to (n) data points starting from (s), the addition data and horizontal parity data of high-order 8 bits and low-order 8 bits are stored to (d) and
(d)+1 respectively.
SM8161 is shared with the RS2, ASCI(P), HEX(P), and CRC(P) instructions. SM8161 must always be off in the 16-bit mode.
SM8161 is cleared when the CPU module mode is changed from RUN to STOP.
In the following program, conversion is executed as follows:
(s)
D100 K100 = 0 1 1 0 0 1 0 0
D100 K111 = 0 1 1 0 1 1 1
D101 K100 = 0 1 1 0 0 1 0 0
D101 K 98 = 0 1 1 0 0 0 1 0
D102 K123 = 0 1 1 1 1 0 1
D102 K 66 = 0 1 0 0 0 0 1 0
D103 K100 = 0 1 1 0 0 1 0 0
D103 K 95 = 0 1 0 1 1 1 1
D104 K210 = 1 1 0 1 0 0 1 0
D104 K 88 = 0 1 0 1 1 0 0 0
K1091
1 0 0 0 0 1 0
CCD D100 D0 K10
SM400
SM8161
X10




0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1
D0
0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1
D1
Example of data contents
lowest-order byte
highest-order byte (1)
lowest-order byte
highest-order byte
lowest-order byte (1)
highest-order byte
lowest-order byte
highest-order byte (1)
lowest-order byte
highest-order byte
Total
Horizontal parity (1)
16-bit conversion mode
When the number of "1" is odd, the horizontal parity is "1".
When the number of "1" is even, the horizontal parity is "0".
1091 in BCD.
Horizontal parity