Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50325/rotshi.b11
There are no other files named rotshi.b11 in the archive.
! File:   ROTSHI.B11
!
!    This work was supported by the Advanced Research
!    Projects Agency of the Office of the Secretary of
!    Defense (F44620-73-C-0074) and is monitored by the
!    Air Force Office of Scientific Research.

MODULE ROTSHIFT=
BEGIN

	    %<  The BLISS-11 out of line shift and rotate routines  >%

	! As specified by the BLISS-11 definition, shifts are
	! arithmetic (sign-extending) and rotates include the hardware
	! carry bit.  Further details of the operation of the shift and
	! rotate operations are implicit in the definitions of the
	! PDP-11 hardware instructions ASL, ASR, ROL, and ROR.
	!
	!					March 1973
	!					R. Levin
	!					R. Johnsson


    GLOBAL ROUTINE ROTATE(THING,NO)=
	BEGIN
	REGISTER V;
	V_.THING;
	IF .NO LSS 0
	    THEN INCR I FROM .NO+1 TO 0 DO V_.V ROT (-1)
	    ELSE DECR I FROM .NO-1 TO 0 DO V_.V ROT 1;
	.V
	END;



    GLOBAL ROUTINE SHIFT(THING,NO)=
	BEGIN
	REGISTER V;
	V_.THING;
	IF .NO LSS 0
	    THEN INCR I FROM .NO+1 TO 0 DO V_.V^(-1)
	    ELSE DECR I FROM .NO-1 TO 0 DO V_.V^1;
	.V
	END;


END