unsigned char *R2, *R1, tmp0, tmp1;
if ( tmp0 != tmp1 || tmp0 == '\0' ) {
If this instruction is executed with R3 set to 0, it is ignored and has no effect on registers and flags. |
This instruction compares strings in successively higher addresses specified by R1, which indicates the source address for comparision, and R2, which indicates the destination address for comparision, until the values do not match or the null character "\0" (= 00h) is detected, with the number of bytes specified by R3 as the upper limit. |
In execution of the instruction, the data may be prefetched from the source address for comparison specified by R1 and the destination address for comparison specified by R2, with R3 as the upper limit. For details of the data size to be prefetched, refer to the hardware manual of each product. |
An interrupt request during execution of this instruction will be accepted, so processing of the instruction will be suspended. That is, execution of the instruction will continue on return from the interrupt processing routine. However, be sure to save the contents of the R1, R2, R3, and PSW when an interrupt is generated and restore them when execution is returned from the interrupt routine. |
C : This flag is set if the operation of (*R1 - *R2) as unsigned integers produces a value greater than or equal to 0; otherwise it is cleared.
Z : This flag is set if the two strings have matched; otherwise it is cleared.