%ROUTINE scalereg(%INTEGER reg,scale) !*********************************************************************** !* Performs a simple shift optimising shifts by 0 & 1 * !* While were are working to the LARGE Unix model arrays * !* are restricted to 64K bytes hence any index can not be larger * !* than 16 bits after scaling and can use 16 bit instructions * !* If we move to the HUGE model then this routine will have to * !* do 32 shifts with only 16 bit instructions -- Repulsive * !*********************************************************************** %IF scale<=0 %THEN %RETURN %IF scale=1 %THEN OpRRS(ADD,reg+1,reg+1) %ELSE OpLit(SHL,scale,reg+1) %END %END %OF %FILE