.TITLE Move Translated Characters Srclen = 4 Srcaddr = 8 Fill = 12 Tbladdr = 16 Dstlen = 20 Dstaddr = 24 .PSECT _Lib_MOVTC, EXE, NOWRT, LONG .ENTRY Lib_MOVTC, ^M ;++ ; ; Author: Jonathan Welch ; ; Functional description: ; ; The source string is translated and replaces the ; destination stirng. Translation is accomplished by using each byte ; of the source string as an index into a 256-byte table whose zeroth ; entry address is specified by the table address operand. The byte ; selected replaces the byte of the destination string. if the ; destination string is longer than the source string, the highest ; addressed bytes of the destination string are replaced by the fill ; operand. If the destination string is shorter than the source ; string, the highest addressed bytes of the source string are not ; translated and moved. The operation of the instruction is such ; that overlap of the source and destination strings does not affect ; the result. If the destination string overlaps the translation ; table, the destination string is unpredictable. ; ; Calling sequence: ; ; Sts = Lib_Movtc(Srclen, Srcaddr, Fill, Tbladdr, Dstlen, Dstaddr) ; ; Formal arguments: ; ; Srclen ; VMS Usage : unsigned_word ; type : word (unsigned) ; access : read only ; mechanism : by value ; ; Length of source string to be translated ; ; Srcaddr ; VMS Usage : address ; type : longword (unsigned) ; access : read only ; mechanism : by value ; ; Address of the first byte in the source string. ; ; Fill ; VMS Usage : byte_unsigned ; type : byte (unsigned) ; access : read only ; mechanism : by value ; ; Value of the fill character. ; ; Tbladdr ; VMS Usage : address ; type : longword (unsigned) ; access : read only ; mechanism : by value ; ; Address of the first byte in the translation table. ; ; Dstlen ; VMS Usage : word_unsigned ; type : word (unsigned) ; access : read only ; mechanism : by value ; ; Length of the destination string translated characters are to be ; moved into. ; ; Dstaddr ; VMS Usage : address ; type : longword (unsigned) ; access : read only ; mechanism : by value ; ; Address of the first byte in the destination string. ; ; Implicit Inputs: ; ; none ; ; Implicit Outputs: ; ; none ; ; Routine Value: ; R0 = number of translated bytes remaining in source string; ; R0 is nonzero only if source string is longer than ; destination string. MOVTC Srclen(AP), @Srcaddr(AP), Fill(AP), @Tbladdr(AP), - Dstlen(AP), @Dstaddr(AP) RET .END