4 ms·
I assume you're referring to the use of the 'register' keyword? well, that's not "memory mapped registers!" That's a suggestion to the compiler that it should s
by allenbrunson 14y ago
I assume you're referring to the use of the 'register' keyword? well, that's not "memory mapped registers!" That's a suggestion to the compiler that it should store a variable in a cpu register, if possible. that means that you can't take the address of that variable, and so on.
Last I heard, 'register' is pretty much obsolete these days, because there is no way you can do better at guessing which variables are candidates to be stored in registers than the compiler can.
- CJefferson 14y agoNo, he is refering to the fact that the original Duff's device contains: *to = *from++ Note that there isn't a '++' on 'to'. Make people think that Duff's device is for making a fast memcpy (which you would get with to++ = from++), but in fact it was for copying data to a MMR. Nowadays, most of the loop would be optimised away by the compiler, unless you marked to as volatile. Assuming you mark to as volatile, this kind of code is still used to write the MMR, although they are much less used than they used to be. The last time I wrote code anything like this was on the Nintendo Gameboy Advance. I don't know if the DS / 3DS still use similar code.