22.11.2.2 Compare Memory

Compares two blocks of data at the specified positions (offset), and writes the comparison result to the storage address.
The following values are stored as the comparison result: When the values are equal: When the target data is larger than the original data: When the target data is smaller than the original data: When an error occurs, the error status value is written to LS9152.

_memcmp ([Compared block Address], [Compare To Block Address], [Comparison Result Storage Address], Offset from Start of Block, Number of Compared Words, Words in 1 Block)

Example expression 1:

_memcmp ([w:[#INTERNAL]LS1000], [w:[#INTERNAL]LS1005], [w:[#INTERNAL]LS0100], 0, 1, 5)

Since the source value is smaller than the target value, the comparison result "2" is stored in LS0100.

Example expression 2:

_memcmp ([w:[#INTERNAL]LS1000], [w:[#INTERNAL]LS1010], [w:[#INTERNAL]LS0100], 2, 3, 5)

Since the values of the original and target data match, the comparison result "0" is stored in LS0100.

Editor Function Name

LS Area

Error Status

Cause

_memcmp ( )

LS9152

0000h

Completed Successfully

0001h

Parameter error

0003h

Write/Read error