This preview shows page 1. Sign up to view the full content.
Unformatted text preview: claim that the effect of this procedure is to swap the values stored at the locations denoted by pointer variables x and y. Note that unlike the usual technique for swapping two values, we do not need a third location to temporarily store one value while we are moving the other. There is no performance advantage to this way of swapping. It is merely an intellectual amusement. Starting with values and in the locations pointed to by x and y, respectively, ﬁll in the following table giving the values stored at the two locations after each step of the procedure. Use the ring properties to show that the desired effect is achieved. Recall that every element is its own additive inverse, that is, ˆ ¼. Step Initially Step 1 Step 2 Step 3 *x *y One common use of bit-level operations is to implement masking operations, where a mask is a bit pattern that indicates a selected set of bits within a word. As an example, the mask 0xFF (having 1s for the least signiﬁcant eight bits) indicates the low-order byte of a word. The bit-level operation x &am...
View Full Document
- Spring '10
- The American