Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
24 Applied Instructions (Others)
24.4 CRC / Cyclic Redundancy Check
593
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
Function and operation explanation
1. 16-bit operation
CRC value is generated for "n" 8-bit data (unit: byte) starting from a device specified in , and stored to the
device specified by .
The 8-bit conversion mode and 16-bit conversion mode are available in this instruction, and the mode can be
switched by turning ON or OFF M8161. For the operation in each mode, refer to the later descriptions.
1) 16-bit conversion mode [M8161 = OFF]
In this mode, the operation is executed for high-order 8 bits (byte) and low-order 8 bits (byte) of a device
specified in .
The operation result is stored to one 16-bit device specified in .
Example: = D100
=D0
n=6
Device
Contents of target data
8 bits 16 bits
Device storing data for
which the CRC value is
generated
Low-order byte Low-order bits of D100 01H
0301H
High-order byte High-order bits of D100 03H
+1
Low-order byte Low-order bits of D101 03H
0203H
High-order byte High-order bits of D101 02H
+2
Low-order byte Low-order bits of D102 00H
1400H
High-order byte High-order bits of D102 14H
...
...
-
+n/2-1
Low-order byte
-
High-order byte
Device storing the
generated CRC value
Low-order byte Low-order bits of D0 E4H
41E4H
High-order byte High-order bits of D0 41H
CRC
EN ENO
d
s
n
Command
input
*1
*2
*3
Device storing the generated CRC value*3.
Number of 8-bit (byte) data for which
the CRC value is generated or the
device storing the number of data
*2.
Head device storing data for which
the CRC value is generated
*1.
M8161
M8000
16-bit conversion mode
CRC
EN ENO
d
s
n
*1
*2
*3
Command input
Head device storing data for which
the CRC value is generated
*1.
Number of 8-bit (byte) data for which the CRC value is
generated or the device storing the number of data
*2.
Device storing the generated CRC value*3.