.TITLE STFILL .IDENT /V02/ .ENABLE LC ; ; This module initialises a string to a particular character ; ; Author: V01 16-Mar-79 Mark Woolfson ; V02 28-Jan-80 Phil Stephensen-Payne ; ; Calling Sequence: ; ; This subroutine is called via the standard FORTRAN calling sequence as:- ; ; CALL STFILL(ASCSTR,ILEN,CHAR [,STATUS]) ; or ; STATUS = STFILL(ASCSTR,ILEN,CHAR) ; ; Where:- ; ASCSTR = Address of the strin to be initialised ; ILEN = Length of the string to be initialised ; CHAR = Character to initialise with ; STATUS = Optional error return ; ; Errors Returned: ; ; STATUS = 0 if the operation was successful ; = -1 if a parameter error was detected ; ; External References: ; ; This module calls the subroutine PRMCHK ; ; STFILL:: MOV #4.,R0 ;SET UP NUMBER OF PARAMS CALL PRMCHK ;CHECK ON PARAMETERS BCS 20$ ;If CS parameter error - exit TST (R5)+ ; Throw away number of parameters MOV (R5)+, R2 ;GET STRING Address MOVB @(R5)+, R1 ;GET STRING LENGTH BIC #177400,R1 ; Clear any sign extension BEQ 20$ ;IF = 0 QUIT ; 10$: MOVB @(R5), (R2)+ ;FILL EACH CHARACTER SOB R1, 10$ ;CHECK FOR END OF FILL ; 20$: RETURN ;QUIT .END