MIT PDP-10 'Info' file converted to Hypertext 'html' format by Henry Baker

Previous Up Next

Shift instructions

The following instructions shift or rotate the AC or the double word formed by AC and AC+1.

Shift instructions are all immediate instructions. The effective address is not used as the ddress of a memory operand. Instead, it is used as the number of places to shift. A positive number means a left shift; a negative number (bit 18 = 1) means a right shift.

Aside from the sign bit of the effective address, only the lowest eight bits are used. The other nine bits are ignored.

Example:
;Suppose that each bit in accumlator 1 is a flag
;telling us that some sort of processing needs to be done.
;We would like to find out which flags are set
;and, for each one, do the processing.  But we don't want to
;waste a lot of time checking flags which are not set.

LOOP:   JFFO 1,[JRST @TABLE(2)]
        ...                     ;Here all flags are zero.

TABLE:  FOO                     ;FOO handles flag bit 0
        BAR                     ;BAR handles flag bit 1.
        ...                     ;Other addresses for the remaining
flags.

FOO:    ...                     ;Do the work.
        TLZ 1,400000            ;Clear flag bit 0
        JRST LOOP               ;Find the next flag which is set.