Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/23/rdx50.sim
There is 1 other file named rdx50.sim in the archive. Click here to see a list.
00100	OPTIONS(/E);
00200	EXTERNAL INTEGER PROCEDURE absadr, storebyte;
00300	EXTERNAL INTEGER PROCEDURE bitfield;
00400	INTEGER PROCEDURE rdx50(id,code);
00500	TEXT id; INTEGER code;
00600	BEGIN !Convert id to "RADIX50" code. At most 6 characters allowed.
00700	Only letters (treated as upper case), digits and " .$%" allowed.
00800	CODE must be 0 or > 3 and <= 8R74.
00900	;
01000	TEXT t;  INTEGER i,j;  CHARACTER c;
01100	t:- IF id.Length > 6 THEN id.Sub(1,6) ELSE id;
01200	WHILE t.More DO
01300	BEGIN
01400	    c:= t.Getchar; i:= i * 8R50;
01500	    IF Letter(c) THEN
01600	    BEGIN i:= i + Rank(c) - 8R66;
01700		IF c >= 'a' THEN i:= i - 8R40;
01800	    END ELSE
01900	    IF Digit (c) THEN i:= i + Rank(c) - 8R57 ELSE
02000	    IF c = '.' THEN i:= i + 8R45 ELSE
02100	    IF c = '$' THEN i:= i + 8R46 ELSE
02200	    IF c = '%' THEN i:= i + 8R47 ELSE
02300	    IF NOT c = ' ' THEN GOTO out;
02400	END;
02500	FOR j:= t.Length - 5 STEP 1 UNTIL 0 DO i:= i * 8R50;
02600	IF NOT code = 0 THEN
02700	BEGIN
02800	    code:= bitfield(code,30,4);
02900	    storebyte(code,8R400400000000 + absadr(i),0);
03000	END;
03100	rdx50:= i;
03200	out:
03300	END rdx50;