MOVTUC

VAX11

 

MOVTUC MOVE TRANSLATED UNTIL CHARACTER

 

Purpose

to move and translate character string, handling escape codes

Format

opcode srclen.rw, srcaddr.ab, esc.rb, tbladdr.ab, dstlen.rw, dstaddr.ab

Operation

 

Condition codes

N ß srclen LSS dstlen;

Z ß srclen EQL dstlen;

V ß {terminated by escape};

C ß srclen LSSU dstlen;

Exceptions

None

Opcodes

2F        MOVTUC                   Move Translated Until Character

Description

The source string specified by the source length and source address operands is translated and replaces the destination/s specified by the destination length and destination address operands. Translation is accomplished by using each byte of the source string as index into a 256-byte table Whose zeros entry address is specified by the table address operand. The byte selected replaces the byte of the destination string. Translation continues until a translated byte is equal to the escape byte or until the source string or destination string is exhausted. if translation is terminated because of escape the condition code V-bit is set; otherwise, his cleared. if the destination string overlaps the source string or the table, destination string and R0 through R5 are unpredictable.

Notes

1. After execution:

R0 = number of bytes remaining in source string (including the byte which caused the escape). R0 is zero only if the entire source string was translated and moved without escape.

R1 = address of the byte which resulted in destination string exhaustion or escape; or if no exhaustion or escape, Rl = address of one byte beyond the source string.

R2 = 0

R3 = address of the table.

R4 = number of bytes remaining in the destination string.

R5 = address of the byte in the destination string which would have received the translated byte that caused the escape or would have received a translated byte if the source string were not exhausted; or if no exhaustion or escape, R1 = address of one byte beyond the destination string.

2. V should be tested before the V and C condition codes to make sure that an escape is detected on the last character of the source string.