-CRC


This option outputs the CRC code.

[Specification format]

-CRC=output_address=operation_range[/operation_method][(initial_value)][:endian]
    operation_range  : {start_address-end_address|section}[,...]
    operation_method : {CCITT|16-CCITT-MSB | 16-CCITT-MSB-LITTLE-4 | 
                 16-CCITT-MSB-LITTLE-2 | 16-CCITT-LSB | 16 | SENT-MSB | 32-ETHERNET}
    endian           : {BIG | LITTLE}[-size-offset]

 

-

Interpretation when omitted

None

[Detailed description]

-

CRC (cyclic redundancy check) operation is done for the specified range of section data in the order from the lower to the higher addresses, and the operation result is output to the specified output address in the specified endian mode.

-

Specify one of the following as the operation method. If the specification of the operation method is omitted, operation is performed assuming that 32-ETHERNET has been specified.

Operation Method

Description

CCITT

The result of CRC-16-CCITT operation is obtained with the MSB first, an initial value of 0xFFFF, and inverse of XOR performed.

The generator polynomial is x16+x12+x5+1.

16-CCITT-MSB

The result of CRC-16-CCITT operation is obtained with the MSB first.

The generator polynomial is x16+x12+x5+1.

16-CCITT-MSB-LITTLE-4

The input is handled in little endian in 4-byte units and the result of CRC-16-CCITT operation is obtained with the MSB first.

The generator polynomial is x16+x12+x5+1.

16-CCITT-MSB-LITTLE-2

The input is handled in little endian in 2-byte units and the result of CRC-16-CCITT operation is obtained with the MSB first.

The generator polynomial is x16+x12+x5+1.

16-CCITT-LSB

The result of CRC-16-CCITT operation is obtained with the LSB first.

The generator polynomial is x16+x12+x5+1.

16

The result of CRC-16 operation is obtained with the LSB first.

The generator polynomial is x16+x15+x2+1.

SENT-MSB

The input is handled in little endian in the lower 4-bit units of one byte and the result of SENT-compliant CRC operation is obtained with the MSB first and an initial value of 0x5.

The generator polynomial is x4+x3+x2+1.

32-ETHERNET

The result of CRC-32-ETHERNET operation is obtained with an initial value of 0xFFFFFFFF, inverse of XOR performed, and the bits reversed.

The generator polynomial is x32+x26+x23+x22+x16+x12+x11+x10+x8 +x7+x5+x4 +x2 +x+1.

-

The specifiable value of initial value ranges from 0x0 to 0xFFFFFFFF when the operation method is 32-ETHERNET, and from 0x0 to 0xFFFF for other cases.

-

When initial value is omitted, operation is performed on the assumption that 0x5 has been specified for the operation method of SENT-MSB, 0xFFFF for CCITT, 0xFFFFFFFF for 32-ETHERNET, and 0x0 for other cases.

-

The operation result is output to the specified output address by writing at the offset location from the beginning of the area allocated by size in the byte order specified with BIG or LITTLE. 0 is output from the beginning of the allocated area until immediately before the offset location.

-

When the size and offset are omitted, the size is assumed to be 2 bytes and the offset is assumed to be 0.

-

When the space option is not specified, space=FF is assumed for CRC operation for the unused areas in the operation range. Note that 0xFF is only assumed for CRC operation for the unused areas, but the areas are not actually filled with 0xFF.

-

Operation is done from the lower to the higher addresses of the specified operation range.

[Example of use]

-

To perform CRC operation for the area from 0x1000 to 0x2FFD and write the result to address 0x2FFE, describe as:

>rlink *.obj -form=stype -start=.SEC1,.SEC2/1000,.SEC3/2000
-crc=2FFE=1000-2FFD -output=out.mot=1000-2FFF

[Remark]

-

When multiple load module files are input, the compiler outputs a warning message and ignores this option.

-

This option is valid when the output format is form={hexadecimal | stype}. For any other cases, the error message is output and execution is terminated.

-

When the space option is not specified and the operation range includes an empty area that is not output, 0xFF is assumed to be stored in the unused area during CRC operation.

-

An error will occur to terminate execution if the CRC operation range includes an overlaid area.

-

The following can be specified for the size and offset when specifying the endian. For any other cases, the error message is output and execution is terminated.

-

LITTLE

-

LITTLE-2-0

-

LITTLE-4-0

-

BIG

-

BIG-2-0

-

BIG-4-0