SMOVB

Transferring a string backward

SMOVB

Strings MOVe Backward


[Syntax]

SMOVB

 

[Operation]

unsigned char *R1, *R2;

unsigned long R3;

while ( R3 != 0 ) {

*R1-- = *R2--;

R3 = R3 - 1;

}

Note

If this instruction is executed with R3 set to 0, it is ignored and has no effect on registers and flags.

[Function]

-

This instruction transfers a string consisting of the number of bytes specified by R3 from the source address specified by R2 to the destination address specified by R1, with transfer proceeding in the direction of decreasing addresses.

-

In execution of the instruction, data may be prefetched from the source address 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.

-

The destination address specified by R1 should not be included in the range of data to be prefetched, which starts from the source address specified by R2.

-

On completion of instruction execution, R1 and R2 indicate the next addresses in sequence from those for the last transfer.

-

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.

 

[Instruction Format]

Syntax

Processng Size

Code Size

(Byte)

SMOVB

B

2

 

[Flag Change]

-

This instruction does not affect the states of flags.

 

[Description Example]

SMOVB