Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-05 - decus/20-0150/outoct.sim
There is 1 other file named outoct.sim in the archive. Click here to see a list.
00100	OPTIONS(/E);
00200	PROCEDURE outoct (n,w); INTEGER n,w;
00250	!TO OUTPUT INTEGER N IN OCTAL IN FIELD OF SIZE W >=12;
00300	BEGIN INTEGER rem,i,sn; CHARACTER dig;
00400	    TEXT int;
00500	    int :- Blanks (w); sn:=1;
00600	    IF n<0 THEN BEGIN sn:=-1; n:=-n-1 END;
00700	    FOR i:=0 STEP 1 UNTIL 11 DO BEGIN
00800		rem := Mod(n,8) ; IF sn<0 THEN rem:=7-rem;
00900		n:= n//8;
01000		dig:= Char(rem+8R60);
01100		int.Setpos (w-i);
01200		int.Putchar(dig);
01300	    END;
01400	    Outtext(int);
01500	END OUTOCT;