7 APPLICATION INSTRUCTION
7.17 Data operation instruction
575
7
• These instructions generate CRC value for (n) 8-bit data (unit: byte) starting from a device specified in (s), and store to (d).
The 16-bit conversion mode and 8-bit conversion 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)
In this mode, the operation is executed for high-order 8 bits (1 byte) and low-order 8 bits (1 byte) of a device specified in (s). The operation result is stored
to one 16-bit device specified in (d).
In the following program, conversion is executed as follows:
Example) (s) = D100, (d) = D0, (n) = 6
Device Contents of target data
8 bits 16 bits
Device storing data
for which the CRC
value is generated
(s) Low-order byte Low-order bits of D100 01H 0301H
High-order byte High-order bits of D100 03H
(s)+1 Low-order byte Low-order bits of D101 03H 0203H
High-order byte High-order bits of D101 02H
(s)+2 Low-order byte Low-order bits of D102 00H 1400H
High-order byte High-order bits of D102 14H

(s)+(n)/2-1 Low-order byte 
High-order byte
Device storing the
generated CRC value
(d) Low-order byte Low-order bits of D0 E4H 41E4H
High-order byte High-order bits of D0 41H
• 8-bit conversion mode (while SM8161 is ON)
In this mode, the operation is executed only for low-order 8 bits (low-order 1 byte) of a device specified by (s). With regard to the operation result, low-
order 8 bits (1 byte) are stored to a device specified by (d), and high-order 8 bits (1 byte) are stored to a device specified by (d)+1.
In the following program, conversion is executed as follows:
Example) (s) = D100, (d) = D0, (n) = 6
Device Contents of target data
Device storing data for
which the CRC value
is generated
(s) Low-order byte Low-order bits of D100 01H
(s)+1 Low-order byte Low-order bits of D101 03H
(s)+2 Low-order byte Low-order bits of D102 03H
(s)+3 Low-order byte Low-order bits of D103 02H
(s)+4 Low-order byte Low-order bits of D104 00H
(s)+5 Low-order byte Low-order bits of D105 14H

(s)+(n)-1 Low-order byte 
Device storing the
generated CRC value
(d) Low-order byte Low-order bits of D0 E4H
(d)+1 High-order byte High-order bits of D0 41H
CRC (s) (d) (n)
SM400
SM8161
Command
input
16-bit conversion mode
CRC (s) (d) (n)
SM400
SM8161
Command
input
8-bit conversion mode