2.11. 2.11 Shifts and Rotates

Another set of logical operations that apply to bit strings are the shift and rotate operations. These two categories can be further broken down into left shifts, left rotates, right shifts, and right rotates. These operations turn out to be extremely useful to assembly language programmers.

The left shift operation moves each bit in a bit string one position to the left (Figure 2-8 provides an example of an 8-bit shift).

Figure 2-8. Shift Left Operation.

Bit zero moves into bit position one, the previous value in bit position one moves into bit position two, and so on. There are, of course, two questions that naturally ...

Get Art of Assembly Language, 1st Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.