.ENABL LC .TITLE SBUILD SUBROUTINE SBUILD (OUT, LEN, STR1,...,STRn) .IDENT /V01.00/ ;***************************************************************************** ; ; Description : Concatenates n strings to an output string but no more ; than a given number of characters ; ; Arguments : OUT = STRING to which all others are concatenated ; LEN = (optional) INTEGER maximum number of characters ; STRm = a STRING to be concatenated ; ; Author : T.Pijl ; AKZO PHARMA, Oss Holland ; dept. SDA ; ; Version : V1.0 Date : 6-jan-83 ; ; Module name : SBUILD.MAC ; ; Package : RSX-LIBRARY ; ; Compilation/Linking : MAC SBUILD ; ; Updates : name version ; ; description : ; ;***************************************************************************** .GLOBL CONCAT SBUILD:: MOVB (R5),R0 ;Save number of arguments CMP R0,#3 ;Min. 3 arguments BLT EXIT ; otherwise do nothing SUB #2,R0 ;calculate number of strings MOV R0,COUNT TST (R5)+ ;point to 1st argument MOV (R5),ARGLST+2 ;LEFTstring argument for CONCAT MOV (R5)+,ARGLST+6 ;OUTstring argument for CONCAT MOV (R5)+,ARGLST+10 ;LEN argument for CONCAT MOV R5,R1 NEXT: MOV #ARGLST,R5 ;R5 points to arglist of CONCAT MOV (R1)+,ARGLST+4 ;RIGHTstring argument for CONCAT MOV R1,-(SP) CALL CONCAT MOV (SP)+,R1 DEC COUNT ;next RIGHTstring BNE NEXT EXIT: RETURN ARGLST: .WORD 4 ;number of arguments .WORD 0 ;LEFT string argument .WORD 0 ;RIGHT string argument .WORD 0 ;OUT string argument .WORD 0 ;LEN argument COUNT: .WORD 0 ;number of strings to concatenate .END