Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site osu-eddie.UUCP Path: utzoo!linus!decvax!harpo!whuxlm!whuxl!houxm!ihnp4!cbosgd!osu-eddie!lum From: lum@osu-eddie.UUCP (Lum Johnson) Newsgroups: net.lang.c Subject: Re: C programming hint Message-ID: <475@osu-eddie.UUCP> Date: Fri, 19-Jul-85 11:18:43 EDT Article-I.D.: osu-eddi.475 Posted: Fri Jul 19 11:18:43 1985 Date-Received: Sun, 21-Jul-85 23:07:10 EDT References: <899@teddy.UUCP> <2412@sun.uucp> <913@teddy.UUCP> Reply-To: lum@osu-eddie.UUCP (Lum Johnson) Distribution: net Organization: Ohio State Univ., CIS Dept., Cols, Oh. Lines: 21 In article <913@teddy.UUCP> kps@teddy.UUCP writes: > > char blanks[SIZE]; > blanks[0] = ' '; > strncpy(blanks + 1, blanks, SIZE - 1); /* initialize entire array */ > > ... I've been bludgeoned to death with the fact that my method is > implementation dependent and that it won't work all the time. This actually works in assembly language for the PDP-10. movei t1," " ; put in reg movem t1,blanks ; deposit char in buffer move t1,[blanks,,blanks+1] ; control register for blt blt t1,blanks+size ; propagate char over buffer The BLT iterates the copy-previous-char operation (specified in t1), incrementing both halves of the control register (t1) until blanks+size is reached. Lum Johnson ..!cbosgd!osu-eddie!lum or lum@osu-eddie.uucp