This preview shows page 1. Sign up to view the full content.
Unformatted text preview: p; 0xFF yields a value consisting of the least signiﬁcant byte of x, but with all other bytes set to 0. For example, with x 0x89ABCDEF, the expression would yield 0x000000EF. The expression ˜0 will yield a mask of all 1s, regardless of the word size of the machine. Although the same mask can be written 0xFFFFFFFF for a 32-bit machine, such code is not as portable. Practice Problem 2.7:
Write C expressions for the following values, with the results for x size shown in square brackets: 0x98FDECBA and a 32-bit word A. The least signiﬁcant byte of x, with all other bits set to 1 [0xFFFFFFBA]. B. The complement of the least signiﬁcant byte of x, with all other bytes left unchanged [0x98FDEC45]. C. All but the least signiﬁcant byte of x, with the least signiﬁcant byte set to 0 [0x98FDEC00]. Although our examples assume a 32-bit word size, your code should work for any word size
Û . Practice Problem 2.8:
The Digital Equipment VAX computer was a very popular machine from the late 1970s until the l...
View Full Document