MOVBF

From NDWiki
Jump to navigation Jump to search
MOVBF
Description Move bytes forward
Format MOVBF
Code 140 1328
Affected P,A,D,X,T, memory region defined by X,T
Type User
Architecture ND-100, ND-110

MOVBF is an assembly instruction. A block of bytes is copied from the location specified for the source operand to the location specified for the destination operand. The instruction is similar to MOVB except that overlap is not taken care of. In case of overlap causing data destruction there will be an error return (no skip return).

The source operand is defined by the A and D registers. The destination operand is defined by the X and T registers.

See BFILL for an explanation of how the operands are defined. Source: A and D registers. Destination: X and T registers.

The number of bytes copied is the shortest field length value of the two operands.

After execution both operands point to the end of the respective source- and destination fields (after the last byte copied). Bits 0-11 (field length) of the D register equals zero and bits 0-11 of the T register contain the number of bytes moved.[*]

Bits 12-13 of the T register and bit 12 of the D register are used during execution, and are left cleared. Bit 13 must be zero before execution, it is used as an interrupt mark.

The P register is incremented by two when this instruction is finished without error, i.e. any instruction directly following MOVBF will not be executed. In case of forbidden overlap (source data to be moved will be destroyed) the P register is incremented by one instead of two.

[*] Footnote:
The ND-100 Reference Manual (06.014.02) and the ND-110 Instruction Manual (ND-06.092.01) disagree about the T register after completion of the instruction. 06.014.02 states that both D and T are decremented by the number of bytes moved, i.e. that if source- and destination fields have the same length then the field length part of both D and T would be zero after completion.

References

The older document is more accurate and detailed for this instruction.