"Krumble Bunk" <> writes:
> Good morning c.l.c,
>
> I have a question regarding the following snippet of code.
>
> static inline void WriteMemory(register word Address,register byte
> Value)
> {
> MemoryPage[Address>>13][Address&0x1FFF]=Value;
> }
>
>
> 1) Why is 'Address' shifted right by 13 places? What is that actually
> doing? (apart from dividing). What i'm getting at, is why use those
> precise values? 13 and 0x1FFF - what's special about them, indivudually
> and in combination in the 2D array?
If the programmer had followed the practice of giving names to the
"magic numbers" in the code, it would have been easier for you to
obtain the answers to those questions. See for example:
http://en.wikipedia.org/wiki/Magic_n...umbers_in_code