July 2002
Intermediate to advanced
320 pages
8h 15m
English
Assume memory is divided into blocks that are a power of 2 in size, starting at address 0. The blocks may be words, doublewords, pages, and so on. Then, given a starting address a and a length l, we wish to determine whether or not the address range from a to a + l − 1, l ≥ 2, crosses a block boundary. The quantities a and l are unsigned and any values that fit in a register are possible.
If l = 0 or 1, a boundary crossing does not occur, regardless of a. If l exceeds the block size, a boundary crossing does occur, regardless of a. For very large values of l (wraparound is possible), a boundary crossing can occur even if the first and last bytes of the address range are in the same block.
There is ...
Read now
Unlock full access